简体   繁体   中英

iOS 7 Status Bar Collides With NavigationBar using ViewController

I am a beginner with iOS development. Currently I have migrating a ios5 code to the ios7.

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);

The interface etc, is generated directly via ViewController code and not using Interface Builder or StoryBuilder.

Please advice..

UPDATE:

Using the following in all 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"

在此处输入图片说明

Programmatically ,

self.edgesForExtendedLayout = UIRectEdgeNone;

在用户列表中将基于View Controller的状态栏外观设置为NO。

You should add

if(IS_IOS7)
{
    self.edgesForExtendedLayout=UIRectEdgeNone;
}

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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