ios7中设备底部的小空间 [英] Small space at the bottom of the device in ios7

查看:63
本文介绍了ios7中设备底部的小空间的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在开发一个适用于ios6和ios7的应用程序



我的问题是,如果我在设备中检查我的应用程序,那么有一个小的空白等于屏幕底部状态栏的大小。



如果我在屏幕顶部放置一个虚拟状态栏,它会在ios6中出现问题,如果我在你有任何解决方案。

解决方案

这是将应用程序从IOS 6迁移到IOS 7时常见的状态栏问题搭乘问题:



更多参考资料



https://stackoverflow.com/a/19025547/1545180



您需要为所有设置delta值控件然后将所有控件的原点x增加到20pix。



步骤1:将原点y增加到20像素(对于.xib中的所有控件)
第2步。对于Xib中的所有控件,将delta y设置为-20。
第3步。最后将视图更改为界面构建器中的版本。



如果以编程方式添加控件,则需要处理框架(根据y位置增加y位置) (如[([[[UIDevice currentDevice] systemVersion] floatValue]> = 7.0 f)
{
[_programmaticallyAddedControl setFrame:CGRectMake(20,36,176,428)];
}
else
{
[_programmaticallyAddedControl setFrame:CGRectMake:CGRectMake(20,56,176,428)];
}


We are developing an application working on both ios6 and ios7

My problem is that, If I check my application in device there is a small white space equal to the size of the status bar at the bottom of the screen.

If I put a dummy status bar at the top of the screen it will make problem in ios6, Help me if you have any solution.

解决方案

That is the common status bar issue while migrating application from IOS 6 to IOS 7 use this to get ride of the issue:

For more reference

https://stackoverflow.com/a/19025547/1545180

You need to set the delta value for all the controls followed by increasing the origin x to 20pix for all the controls.

Step 1: Increase origin y to 20 pixel (for all the controls in the .xib) step 2 . And set delta y to - 20 for all the controls in Xib. Step 3 . Finally change the view as version in interface builder.

If your adding the controls programmatically you need to handle the frames (increase the y position based on the version ) of the added controls like this

 if([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0f)
    {
        [_programmaticallyAddedControl setFrame:CGRectMake(20, 36, 176, 428)];
    }
    else
    {
        [_programmaticallyAddedControl setFrame:CGRectMake:CGRectMake(20, 56, 176, 428)];
    }

这篇关于ios7中设备底部的小空间的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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