如何使用Objective C为iPad制作启动画面大小?

时间:2016-02-08 04:19:57

标签: ios objective-c iphone ipad splash-screen

我正在尝试通过编程方式为splash screeniPhone创建iPad。在下面我添加了我正在使用的代码并输出屏幕显示半屏的iPad2模拟器。我需要为iPad所有设备制作全屏尺寸。

我的代码如下:

 // The device is an iPad and iPad mini running iOS 3.2 or later.
        CGSize result = [[UIScreen mainScreen] bounds].size;
        if(result.height == 1024) {

            // iPad, iPad 2, iPad Mini
            splashImage.frame = CGRectMake(0, 0, 768,result.height);
            [splashImage setImage:[UIImage imageNamed: @"Default-Portrait.png" ]];
            activityIndicator.frame=CGRectMake(145, 240, 30, 30);
        }
        if(result.height == 2048) {

            // iPad Air, iPad Mini Retina
            splashImage.frame = CGRectMake(0, 0, 1536,result.height);
            [splashImage setImage:[UIImage imageNamed: @"Default-Portrait.png" ]];
            activityIndicator.frame=CGRectMake(145, 240, 30, 30);
        }

enter image description here

1 个答案:

答案 0 :(得分:0)

IPAD SPLASH

 iPadImage-Appname-Portrait.png * 768w x 1004h (with status bar)
 iPadImage-Appname-Portrait@2x.png * 1536w x 2008h (with status bar)
 iPadImage-Appname-Landscape.png ** 1024w x 748h (with status bar)
 iPadImage-Appname-Landscape@2x.png ** 2048w x 1496h (with status bar)

 iPadImage-Appname-Portrait.png * 768w x 1024h (without status bar)
 iPadImage-Appname-Portrait@2x.png * 1536w x 2048h (without status bar)
 iPadImage-Appname-Landscape.png ** 1024w x 768h (without status bar)
 iPadImage-Appname-Landscape@2x.png ** 2048w x 1536h (without status bar)