将我的应用程序缩放为3.5英寸的屏幕 [英] Scaling my app for a 3.5 inch screen
问题描述
我几乎已经完成了我的第一个应用程序,并牢记了4英寸iPhone屏幕.
I've almost completed my first app and made it with the 4 inch iPhone screen in mind.
它仅在potrait模式下有效,并且图形繁重.我希望它能在具有3.5英寸屏幕的iPhone 4和4s上运行.现在,当我在模拟器中运行该应用程序时,它只是将底部切开了一点,以适应3.5英寸的屏幕.
It only works in potrait mode and isn't graphics heavy. I want it to work on the iphone 4 and 4s which have 3.5 inch screens. Right now when I run the app in simulator, it just cuts a bit off the bottom to accommodate the 3.5 inch screen.
有没有办法让我所有的按钮和标签都可以垂直缩小一点,以便在3.5英寸显示屏上正常工作?
Is there a way I can just get all my buttons and labels to vertically shrink a little to work on the 3.5 inch display?
在这种情况下最简单和最佳的做法是什么?
What's the easiest and best practice in this situation?
谢谢
推荐答案
我处理3.5英寸vs 4英寸屏幕的一种方法是制作两个单独的.xib文件,并使用此检查加载相应的文件:
One way I handle the 3.5 inch vs 4 inch screen is making two separate .xib files and load the appropriate one using this check:
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 480)
{
//Load 3.5 inch xib
}
if(result.height == 568)
{
//Load 4 inch xib
}
}
这篇关于将我的应用程序缩放为3.5英寸的屏幕的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!