iPhone应用程序中奇怪的状态栏偏移 [英] Weird statusbar offset in iPhone app

查看:169
本文介绍了iPhone应用程序中奇怪的状态栏偏移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个应用程序,并且希望使其全屏显示,但是当我隐藏状态栏时,我得到了44px(状态栏大小)的偏移量.

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

带有状态栏的按钮在行上: http://i55.tinypic.com/xlbjsz.png

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

然后,我在Info.plist文件中设置了状态栏最初处于隐藏状态:是",然后得到了一个偏移量: http://i55.tinypic.com/2up3ceo.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

当我取消选中自动调整大小"子视图时,我得到以下信息: http://i54.tinypic.com/2h821r4.png

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

我没有将所有xibs状态栏(包括window.xib)置于任何位置,我没有任何想法,请帮助我.

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

推荐答案

从您上传的图像来看,一切似乎都可以正常运行.隐藏状态栏时,视图将上移状态栏先前用于显示自身的像素量.

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.

因此,如果在显示状态栏时视图大小为320 x 460(状态栏的高度为20px,所以如果将其相加,它将使其变为iPhone完整屏幕尺寸的320 x 480)您的视图将具有320 x 480的新尺寸.

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.

默认情况下,您的视图会自动调整内部视图的大小,当您检出视图时,在页面底部留出20px的间隙是正常的.

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.

请记住,在视网膜显示屏(iPhone 4)上,所有这些尺寸都会加倍,因此实际上在底部会出现40像素的间隙.

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.

这篇关于iPhone应用程序中奇怪的状态栏偏移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆