UIViewController's view is too low when navigation bar is opaque
When I set the navigationBarHidden to NO, yet I make the navigation bar
translucent, I print the frame when I initialize it with initWithFrame:,
and it is {{0, 0}, {320, 504}}. The view appears beneath the
navigationBar. Then when I set the navigation bar to not be translucent,
with [[self.navigationController navigationBar] setTranslucent:NO], I
print the frame's view and it's {{0, 0}, {320, 504}}. I scaled the iPhone
simulator so it's the same size as the actual 4-inch iPhone, and here's a
screenshot. You can see the there's now a giant space between the
navigation bar and the top of my view, which is red. What's causing the
space? The only difference between the two pictures is I've commented out
[[self.navigationController navigationBar] setTranslucent:NO] in the first
one.
No comments:
Post a Comment