问题描述
我是iOS开发的初学者.目前,我已将ios5代码迁移到ios7.
I am a beginner with iOS development. Currently I have migrating a ios5 code to the ios7.
在我的代码中遇到以下重叠问题: http://s17.postimg.org/90m7mx5lb/collide.png
Getting the following overlap issue in my code : 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);
接口等是直接通过ViewController代码生成的,而不是使用Interface Builder或StoryBuilder.
The interface etc, is generated directly via ViewController code and not using Interface Builder or StoryBuilder.
请提出建议.
更新:
在所有ViewController中使用以下内容
Using the following in all viewcontroller
UIImage *stretchImage=[UIImage imageNamed:kNavigationBg]; stretchImage=[stretchImage stretchableImageWithLeftCapWidth:1 topCapHeight:0]; [self.navigationController.navigationBar setBackgroundImage:stretchImage forBarMetrics:UIBarMetricsDefault];
UIImage *stretchImage=[UIImage imageNamed:kNavigationBg]; stretchImage=[stretchImage stretchableImageWithLeftCapWidth:1 topCapHeight:0]; [self.navigationController.navigationBar setBackgroundImage:stretchImage forBarMetrics:UIBarMetricsDefault];
推荐答案
您应该添加
if(IS_IOS7)
{
self.edgesForExtendedLayout=UIRectEdgeNone;
}
这篇关于iOS 7状态栏使用ViewController与NavigationBar发生碰撞的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!