[英]iOS 7 Status Bar Collides With NavigationBar using ViewController
I am a beginner with iOS development. 我是iOS开发的初学者。 Currently I have migrating a ios5 code to the ios7.
目前,我已将ios5代码迁移到ios7。
Getting the following overlap issue in my code : http://s17.postimg.org/90m7mx5lb/collide.png 在我的代码中出现以下重叠问题: http : //s17.postimg.org/90m7mx5lb/collide.png
I have updated the app delegate with the following code : 我已使用以下代码更新了应用程序委托:
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
The interface etc, is generated directly via ViewController code and not using Interface Builder or StoryBuilder. 接口等直接通过ViewController代码生成,而不使用Interface Builder或StoryBuilder。
Please advice.. 请指教..
UPDATE: 更新:
Using the following in all viewcontroller 在所有ViewController中使用以下内容
UIImage *stretchImage=[UIImage imageNamed:kNavigationBg]; stretchImage=[stretchImage stretchableImageWithLeftCapWidth:1 topCapHeight:0]; [self.navigationController.navigationBar setBackgroundImage:stretchImage forBarMetrics:UIBarMetricsDefault];
Select each ViewController in your Storyboard and, tick both options "Under top bars" , "Under bottm bars" 选择情节提要中的每个ViewController,然后在“顶部栏下方”,“底部栏下方”两个选项中打勾
Programmatically , 以编程方式
self.edgesForExtendedLayout = UIRectEdgeNone;
在用户列表中将基于View Controller的状态栏外观设置为NO。
You should add 您应该添加
if(IS_IOS7)
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.