[英]iOS 7 Status Bar Collides With NavigationBar using ViewController
我是iOS开发的初学者。 目前,我已将ios5代码迁移到ios7。
在我的代码中出现以下重叠问题: http : //s17.postimg.org/90m7mx5lb/collide.png
我已使用以下代码更新了应用程序委托:
self.window.frame = CGRectMake(0,20,self.window.frame.size.width,self.window.frame.size.height-20);
接口等直接通过ViewController代码生成,而不使用Interface Builder或StoryBuilder。
请指教..
更新:
在所有ViewController中使用以下内容
UIImage *stretchImage=[UIImage imageNamed:kNavigationBg]; stretchImage=[stretchImage stretchableImageWithLeftCapWidth:1 topCapHeight:0]; [self.navigationController.navigationBar setBackgroundImage:stretchImage forBarMetrics:UIBarMetricsDefault];
选择情节提要中的每个ViewController,然后在“顶部栏下方”,“底部栏下方”两个选项中打勾
以编程方式
self.edgesForExtendedLayout = UIRectEdgeNone;
在用户列表中将基于View Controller的状态栏外观设置为NO。
您应该添加
if(IS_IOS7)
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.