self.wantsFullScreenLayout无法在某些VC上运行(self.wantsFullScreenLayout is not working on some VC)

编程入门 行业动态 更新时间:2024-10-27 13:22:28
self.wantsFullScreenLayout无法在某些VC上运行(self.wantsFullScreenLayout is not working on some VC)

我在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?

更多推荐

本文发布于:2023-07-30 13:16:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1337892.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:在某些   wantsFullScreenLayout   working   VC

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!