Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
How do I determine that UIView is showing with navigation bar on top
I know that the presence of the more view controller (navigation bar) pushes down the UIView by its height. I also know that this height = 44px. I have also discovered that this push down maintains the [self.view].frame.origin.y = 0.
So how do I determine the height of this navigation bar, other than just setting it to a constant?
Or, shorter version, how do I determine that my UIView is showing with the navigation bar on top??
If the height of the view's frame is less that the height of the screen, then you have the navigation bar. Also, if the navigation controller is present, you can access the navigation bar through and check it's height. Keep in mind that the status bar can also be present and it can subtract from the total height as well.
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
Quote:
Originally Posted by baja_yu
If the height of the view's frame is less that the height of the screen, then you have the navigation bar. Also, if the navigation controller is present, you can access the navigation bar through and check it's height. Keep in mind that the status bar can also be present and it can subtract from the total height as well.
Thanks.
I've seen articles that confirm your statement on the status bar ... but ... my NSLogs indicate that the status bar has no effect. So, I don't know what is going on.
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
The light bulb started to come on. Unfortunately, I have not discovered a uniform way to correct the problem, as described below.
I believe that my whole problem centers on my autoresizingMasks. And the reason I have concluded that is the same symptoms exist, with or without a UIWebView. And that symptom is that everything is peachy for Portrait. For Landscape, the bottom-most UIButton pops down behind the TabBar.
For example, on one UIView, I have, from top to bottom:
UIView – both springs set (default case) and no struts
UIScrollView -
If I set the two springs, and clear everything else (like the UIView), then the UIButton intrudes on the object immediately above it.
If I clear everything, then UIButton is OK, but the stuff at the very top hides behind the StatusBar
Setting only the top strut, the UIButton pops down behind the Tab Bar.
UILabel and UIImage next vertically – top strut set, flexible everywhere else
Just to complete the picture for the few that have a UIWebView:
UIWebView -
Struts: top, left, right
Springs: both
UIButton – nothing set, i.e., flexible everywhere
Although my light bulb is dim, there appears to be hope.
Location: Marquette, MI (in the beautiful Upper Peninsula)
Posts: 111
After about 2 weeks on tackling this, I decided that the "problem" was made more difficult by placing a UIButton BELOW the UIWebView sub-view. So, I put the button ABOVE it.
Quite frankly, it just doesn't look "right" that way ... but it now works SORT OF. BELOW or ABOVE the UIWebView has set the top strut and just the horizontal spring.
BTW, its the contentHeight of the UIWebView that does not change with rotation. And that's still true even with button ABOVE.
Set top strut and set the two springs - problem solved and thanks bunches.
As a matter of fact, my only remaining problem is to design those cursed @2X, etc. graphics. I use GraphicConverter in a very simple way and it does well for Web Page design, very well. But all these 30px, 57px stuff - I'm going into unchartered territory for me, at least.