UINavigationbar覆盖视图的顶部 [英] UINavigationbar covers top of view
问题描述
我在xib文件中设置了仅包含一个UITextView和一个UINavigationBar的视图.
I have set up a view with only one UITextView and a UINavigationBar in a xib file.
运行应用程序时,即使我在UINavigationBar下方的IB中排列了UITextView,UINavigationBar也遮盖了文本的顶部.
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.
它不仅发生在UITextViews中,还发生在其他类型的视图中,包括简单的UILabel.我的理解是,使用导航栏时,视图的顶部将向下移动,但这不会发生.
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?
推荐答案
更改导航栏的半透明
属性.
正如我从屏幕截图中看到的那样,它位于导航控制器中
As i see from the screenshot it is in the navigationcontroller
[[self.navigationController navigationBar] setTranslucent:NO];
这篇关于UINavigationbar覆盖视图的顶部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!