简体   繁体   English

iOS 7状态栏使用ViewController与NavigationBar碰撞

[英]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.

相关问题 iOS 7状态栏与NavigationBar发生碰撞 - iOS 7 Status Bar Collides With NavigationBar iOS:将导航栏添加到应用程序窗口与状态栏发生冲突 - iOS: Adding navigation bar to Application window collides with status bar UIImagePickerController状态/导航栏iOS 7 - UIImagePickerController Status / Navigationbar iOS 7 ios-不向ViewController上的NavigationBar添加backbutton - ios - Not adding backbutton to NavigationBar on ViewController 呈现ViewController时无法在iOS 6,7上隐藏状态栏 - Unable to hide status bar on iOS 6,7 when presenting viewcontroller iOS:状态栏和ViewController之间的未知黑色补丁 - iOS: Unknown black patch between status bar and ViewController iOS 通话中状态栏更新 viewcontroller 模态呈现在屏幕上 - iOS in-call status bar update viewcontroller presented modaly on screen 仅在一个ViewController中显示/隐藏状态栏,目标C,iOS - Show/Hide status bar in only one ViewController, objective C, iOS iOS:以编程方式隐藏状态栏,基于方法而不基于viewController - iOS: hide status bar programmatically, method based NOT viewController based iOS-NavigationBar标题与以前的viewController重叠 - iOS - NavigationBar Title overlapped by previous viewController
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM