在xcode中开发全屏4英寸应用程序 [英] Developing fullscreen 4inch app in xcode
问题描述
可能重复:
如何支持更高的iPhone 5屏幕尺寸?
如何使我的应用程序4英寸准备好?我在iOS6GM模拟器中的应用程序看起来不是4英寸大小。
xcode中是否有任何选项可以使用全部4英寸?
How to make my app 4inch-ready? My app in iOS6GM simulator looks not 4inch-sized. Is there any option in xcode to use all 4 inches?
推荐答案
有些用户报告在添加启动图像后修复了 Default-568h@2x.png
(见下文)。
为了更新到iPhone5,我做了以下工作:
Some users have reported that it was fixed after adding the startup image Default-568h@2x.png
(see below).
For updating to iPhone5 I did the following:
iOS 6中的自动旋转正在发生变化。在iOS 6中, shouldAutorotateToInterfaceOrientation:不推荐使用code> UIViewController的方法。取而代之的是,您应该使用
supportedInterfaceOrientationsForWindow:
和 shouldAutorotate
方法。因此,我添加了这些新方法(并保持旧的iOS 5兼容性):
Autorotation is changing in iOS 6. In iOS 6, the shouldAutorotateToInterfaceOrientation:
method of UIViewController is deprecated. In its place, you should use the supportedInterfaceOrientationsForWindow:
and shouldAutorotate
methods. Thus, I added these new methods (and kept the old for iOS 5 compatibility):
-(BOOL)shouldAutorotate {
return YES;
}
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskAllButUpsideDown;
}
- 然后我修复了需要的视图的自动布局
- 将用于启动视图的模拟器中的图像和
iTunes商店的视图复制到PhotoShop并将其导出为png文件。 - 默认图像的名称为:Default-568h@2x.png,尺寸为
640 x 1136,屏幕尺寸为320 x 568。 - 我放弃了向后兼容性对于iOS 4.原因是
这个新的Xcode不再支持armv6代码了。因此,我现在能够支持的所有
设备(运行armv7)可以升级到$ 5 $ b到iOS 5. - Then I fixed the autolayout for views that needed it.
- Copied images from the simulator for startup view and views for the iTunes store into PhotoShop and exported them as png files.
- The name of the default image is: Default-568h@2x.png the size is 640 x 1136 and the screen size 320 x 568.
- I have dropped backward compatibility for iOS 4. The reason is that this new Xcode does not support armv6 code any more. Thus, all devices that I am able to support now (running armv7) can be upgraded to iOS 5.
这只是记得在iOS 5和iOS 6中测试自动旋转因为旋转的变化。
That was all but just remember to test the autorotation in iOS 5 and iOS 6 because of the changes in rotation.
这篇关于在xcode中开发全屏4英寸应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!