-
Notifications
You must be signed in to change notification settings - Fork 428
Support for non-translucent navigation bars? #7
Comments
Well, first, yes. You're absolutely right about the cause of the issue. If you noticed, facebook changes the bounds and the Your solution is the way to go! We just need to avoid overriding the layout guides, and make the bound changes within the component. I can take a look at it tonight, or if you care to submit a PR, that would be great as well! If you don't have the time, I think this solution is actually non trivial, since it will require a new "coupling" that doesn't exist now, which is between the |
Im actually experiencing this too, And I don't override, @Mazyod : Hopefully you can support this soon, |
On your view try setting |
@iSevenDays thanks, it works perfect |
@red010182 glad to help you :) |
Anyone thinks the component should check if the navbar is opaque, and do the |
It would be really fantastic to do so. Mazyad Alabduljaleel notifications@github.com 於 2014年10月28日星期二寫道:
|
After experimenting with it, it seems like it is not a silver bullet 😢 I tried to implement the bounds change approach, and it worked well for opaque navbars, but that broke the translucent navbars... This bug in iOS 7 doesn't help at all: |
I also have a need for non-translucent nav bars. Odd thing is, I am using TLYShyNavBar in two views in my app, and one of them appears translucent, and the other does not. I assumed I was just missing something until reading in this thread that an opaque nav bar is not supported. |
@iSevenDays thanks that did it for me. |
I'm using a translucent nav bar, but It's showing a black space when the nav bar is hidden. I'm using a tableview with auto layout. |
@astine-daniel Thanks for reporting this. Are you sure it's translucent? There is already a demo shipping with the component that confirms it should work. If you're sure it's translucent, you may want to check #64, this issue is about non-translucent bars. |
I made a simple project with a UIViewController with a UITableView inside it. By default, it all works fine. Changing the translucent property of the navigation bar to NO however causes some issues. It seems the reason is this component depends on a translucent bar as it only adjusts the content inset of the scroll view (and a scrollview with a non translucent bar doesn't use this functionality since there is no hidden portion). When the navigation bar hides, it leaves a blank space in its place since the underlying view does not actually extend underneath it.
Sample project here: http://cl.ly/2D2F090o2I3d
Wondering if there is a straightforward way to solve this.
The way I have solved it in my app for the short term is as follows:
length
being the height of the navigation bar so TLYShyNavBar can use that value as if the navigation bar is transparent without knowing or caring that it isn't.This solution is working for me at the moment and behaves smoothly but has a few issues. First off, I don't see a way of easily extending this functionality into the component. The second is that overriding the layout guide seems to actually be unsupported behavior and although it is working for me, can cause some issues with autolayout, as shown here.
What do you think?
The text was updated successfully, but these errors were encountered: