UINavigationbar covers top of view

被刻印的时光 ゝ 提交于 2019-12-24 01:12:30

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!