问题
I have set up a view with only one UITextView and a UINavigationBar in a xib file.
When I run the app, the top part of the text is obscured by the UINavigationBar, even though I lined up the UITextView in IB below the UINavigationBar.
It not only happens with UITextViews, also with other type of views, including a simple UILabel. My understanding is that when using a navbar, the top of the views will be shifted down, but this doesn't happen.
Am I missing anything in my setup to prevent this?
回答1:
Change navigation bar translucent property.
As i see from the screenshot it is in the navigationcontroller
[[self.navigationController navigationBar] setTranslucent:NO];
来源:https://stackoverflow.com/questions/15729465/uinavigationbar-covers-top-of-view