【问题标题】:How To Make Splash Screen Sizes For iPad Using Objective C?如何使用 Objective C 为 iPad 制作初始屏幕尺寸?
【发布时间】:2016-05-17 16:21:22
【问题描述】:

我正在尝试以编程方式为iPhoneiPad 创建splash screen。下面我添加了我正在使用的代码并将屏幕输出到 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);
        }

【问题讨论】:

  • 这正是它应该运行的方式,除非它是一个通用应用程序。如果是仅限 iPhone 的应用程序,它将像这样运行(就像 iPad 中的 iPhone 4s 和 4)。

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


【解决方案1】:

IPAD 飞溅

 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)

【讨论】:

  • 我使用相同尺寸但无法正常工作@Reshmi Majumder
  • 你在 info.plist 中设置了吗?
猜你喜欢
  • 2012-04-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-10-13
  • 1970-01-01
  • 1970-01-01
  • 2018-02-09
  • 2015-03-16
相关资源
最近更新 更多