Weird statusbar offset in iPhone app

佐手、 提交于 2019-12-11 14:22:58

问题


I'm working on an app and I want to make it full screen, but when I hide the status bar I get an offset of 44px (status bar size).

With status bar the buttons are on the line: http://i55.tinypic.com/xlbjsz.png

Then I've set in the Info.plist file "Status bar is initially hidden: YES"and I get an offset: http://i55.tinypic.com/2up3ceo.png

And when I uncheck Autoresize subviews I get this: http://i54.tinypic.com/2h821r4.png

I've put on all xibs status bar to none, including window.xib, I don't have any ideas left, please help me.


回答1:


From the images you uploaded it seems everything works as it should. When you hide the status bar your view will shift up the amount of pixels that the status bar was previously using to display itself.

So if the views size is 320 x 460 when the status bar is shown (the status bar has a height of 20px so if you add that up it will make it 320 x 480 the full iPhone screen size) when you hide it your view will have a new size of 320 x 480.

As you said by default your view will autoresize the views inside and when you checked it out it's only normal to get a 20px gap at the bottom of the page.

Please keep in mind that on a retina display (iPhone 4) all these sizes are doubled, so you actually get a 40px gap at the bottom.



来源:https://stackoverflow.com/questions/6705926/weird-statusbar-offset-in-iphone-app

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