简体   繁体   中英

how to run iPhone classic app in iPhone5

I develop application using iOS5.0, now I want to run app in iOS6.0. It's working fine using iPhone classic devices, but not working fine in iPhone5. Because [[UIScreen mainScreen] bounds] is returning {{0, 0}, {320, 480}} in iPhone5, I wrote code using

if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
    CGSize result = [[UIScreen mainScreen] bounds].size;
    if (result.height == 480)
    {
        // iPhone Classic
    }
    else if (result.height == 568)
    {
        // iPhone 5
    } 
}

But screen bounds return same frame. How it will change?

为iPhone 5添加启动屏幕。如果转到“目标”->“常规”->“启动图像”,则会看到警告。

For the application to run in "tall mode", you need to have a Default.png splash screen the correct height for an iPhone 5. This will instruct the application to run in tall mode, meaning you'll get the correct bounds.

Information can be found at the Apple Dev Centre . Basically, you'll need to provide a splash/launch image with a size of 640 x 1136 pixels, and a name of Default-568h@2x.png.

To specify default launch images for iPhone 5 and iPod touch (5th generation) devices, include the modifier string -568h immediately after the portion of the filename. Because these devices have Retina displays, the @2x modifier must always be included with launch images for the devices.

For example, the default launch image name for a device is Default-568h@2x.png. (If your app has the UILaunchImageFile key in its Info.plist file, replace the Default portion of the string with your custom string.).

You can easily add this image via the target settings for the project in Xcode. Simply select your project file, then select the application from the target list. Within General, you'll find settings such as Application Version number, Deployment Target etc... Further down the list you can select your launch images, and there'll be a placeholder for iPhone 5 devices.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM