简体   繁体   English

我如何像ios7一样在ios6的状态栏下启动视图

[英]How do i make my view start under the statusbar in ios6 just like in ios7

Not sure about the title of this question... it's a work in progress. 不确定这个问题的标题...这是一个正在进行的工作。

Anyway, while the internets are full of folks that want to make their ios7 status bar behave the old way, i'm fine with that. 无论如何,虽然互联网上到处都是想让自己的ios7状态栏表现出旧方式的人,但我很好。 However, my problem now is that the view that starts at y=0 in IOS7 jumps down under the status bar in IOS6 . 但是,我现在的问题是, view在IOS7开始在y = 0的状态栏下跳下IOS6

I can and have solved this with the 'delta' ios6/7 thing in interface builder, but i would rather have my views behave exactly the same way, ie my top 20 pixels can be seen in IOS7, but are hidden by a black bar in IOS6. 我可以并且已经使用界面生成器中的“ delta” ios6/7解决了此问题,但是我希望视图的行为完全相同,例如,我的前20个像素可以在IOS7中看到,但被黑条隐藏在IOS6中。 This means that all objects end up in the same Y position before and after IOS7 if you see what i mean. 这意味着,如果您明白我的意思,那么所有对象在IOS7之前和之后都在相同的Y位置结束。

I've tried all sorts of stuff to no avail. 我尝试了各种各样的东西都无济于事。 Is there an easy way to tell xcode that i want my view to start at position 0 and disregard the statusbar in IOS6? 有没有一种简单的方法告诉xcode我希望我的视图从位置0开始,而忽略IOS6中的statusbar

只需在所有视图的viewDidLoad尝试

self.wantsFullScreenLayout = YES;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM