ios7 - iPhone 5 giving white space at the top

爱⌒轻易说出口 提交于 2019-11-28 02:25:29

问题


Client has come back to me on projects saying they see white space on the top (they can't see the default things like time, wifi signal, etc) at the top.

This is happening when they installed iOS7 on their iPad.

Any idea why this is happening?

Note:

I have navigation bar as image. I hide the navigation bar and put navigation bar as an image.


Downvoters

I know this is not a perfect question for SO, but I thought to ask to take inputs. Tomorrow I am going to study on it.


回答1:


try to insert following code into your viewDidLoad:

if( [self respondsToSelector:@selector(edgesForExtendedLayout)] ) {
  self.edgesForExtendedLayout = UIRectEdgeNone;
}

Otherwise you could try it, by removing the UIStatusBar. Select your Project, go to the section General and select Hide during application launch inside the subsection Deployment Info. Next you have to add the attribute inside the Info section called View controller-based status bar appearance and set it to NO.




回答2:


It's due to the status bar.

In your XIB or Storyboard chose to view your xib as iOS 6 :

On your view, add a Content View (you will add your outlets elements inside this content view) and add a Y delta of 20 (for the status bar) :

Now, if you compile your app on iOS 7 or iOS 6, your view will go up or down and you won't have the space anymore.



来源:https://stackoverflow.com/questions/19226751/ios7-iphone-5-giving-white-space-at-the-top

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!