我在Xcode 5中开发,问题只发生在iOS 7以下的iOS版本中。我必须保持状态栏可见。 我在用
self.wantsFullScreenLayout= YES;但我的观点仍然出现在状态栏下方。
我如何解决此问题,以便状态栏不包含视图?
I am developing in Xcode 5, and issue happens only in iOS versions below iOS 7. I have to keep status bar visible. I am using
self.wantsFullScreenLayout= YES;But my view is still appearing beneath the status bar.
How can i fix this so the view is not covered by the status bar?
最满意答案
您需要设置UIViewController视图的Delta。
从公用事业区切换故事板到ios6.1或更高版本(第1项)。
然后选择UIViewController的视图,在实用程序区域的大小检查器菜单中,框架下面会有delta部分。 每个三角洲之前都会有三角形。 将三角形y更改为64(您应该在故事板的“ios6.1或更高版本”上)。
这意味着当在ios7中打开storyboard时,你的UIViewController的视图将自动从64开始。 64是UINavigationbar height + UIStatusbar height。
如果您的UIViewController没有UINavigationBar,那么Delta y = 20,(您应该在故事板的“ios6.1或更高版本”)。
一旦你在一个ios中改变delta,它将自动改变它的反面。
如果您需要关于Deltas的帮助,请访问: Interface Builder:UIView的iOS 6/7 Deltas布局是什么?
You need to set Delta of your UIViewController 's view.
Switch Story board to ios6.1 or later from utility area (1st item).
Then select view of your UIViewController and in size inspector menu in utility area there will be delta section below frame. There will be triangle before every delta. Change Triangle y to 64 (you should be on "ios6.1 or later" of your storyboard).
This means when storyboard is opened in ios7 then your UIViewController's view will start from 64 automatically . 64 is UINavigationbar height + UIStatusbar height.
If your UIViewController dont have UINavigationBar then Delta y = 20,(you should be on "ios6.1 or later" of your storyboard).
Once you change delta's in one ios it will automatically change its opposite.
If you need help on Deltas visit : Interface Builder: What are the UIView's Layout iOS 6/7 Deltas for?
更多推荐
发布评论