【问题标题】:Screen Layout Issues for iPhone-5 large screens [duplicate]iPhone-5大屏幕的屏幕布局问题[重复]
【发布时间】:2012-12-28 06:41:45
【问题描述】:

可能重复:
How to develop or migrate apps for iPhone 5 screen resolution?

当我附上一张图片时,我在 XIB 中为 iPhone-5 屏幕尺寸生成了视图。当我将作为 iPhone5 屏幕的 iPhone-4s 视网膜运行时,它会在 iPhone-4s 屏幕的模拟器中显示为这样。

我已经用屏幕尺寸属性自动完成了所有尺寸设置。

实际上没有解决状态栏问题。 如果屏幕不兼容大屏幕,那么状态栏也应该在顶部。但是为什么中间这么显眼呢?

谁能尽快告诉我解决方法?

提前致谢。

【问题讨论】:

    标签: iphone layout splash-screen statusbar iphone-5


    【解决方案1】:

    您可以将启动图像添加到名为 Default-568h@2x.png

    的项目中

    这将全屏显示您的布局,而不是在中间显示。

    【讨论】:

      【解决方案2】:

      在 Didfinishlaunching 方法的 App 委托类中设置此项:

      [[UIApplication sharedApplication] setStatusBarHidden:YES animated:YES];
      

      【讨论】:

      • 在整个应用程序中,我遇到了同样的问题。所以这不是隐藏状态栏的可行解决方案。我不明白为什么应用程序显示在中间。 ?
      • 我不想隐藏状态栏。所以,我在资源/iphone (640x1136) 中为 iPhone5 创建了一个启动画面。它的名字必须是:Default-568h@2x.png 问题已解决。
      • 兄弟这是正确的解决方案...
      【解决方案3】:

      我之前已经成功了。

      [[UIApplication sharedApplication] setStatusBarHidden:NO]; 写入AppDelegate 和.plist 文件集属性Statusbar is initially hiddenYES

      希望这会对你有所帮助....:)

      【讨论】:

      • 在整个应用程序中,我遇到了同样的问题。所以这不是隐藏状态栏的可行解决方案。我不明白为什么应用程序显示在中间。 ?
      • 我不想隐藏状态栏。因此,我在资源/iphone (640x1136) 中为 iPhone5 创建了启动画面。它的名字必须是:Default-568h@2x.png 问题已解决。
      • 是..另一种方法是为iphone 4和5设置默认图像。然后,以编程方式检查当前设备是iphone 5还是4。据此,您可以设置图像...
      【解决方案4】:

      您可以检查设备屏幕兼容性如下:

      //Device Compatibility
      #define g_IS_IPHONE             ( [[[UIDevice currentDevice] model] isEqualToString:@"iPhone"] )
      #define g_IS_IPOD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPod touch"] )
      #define g_IS_IPAD               ( [[[UIDevice currentDevice] model] isEqualToString:@"iPad"] )
      #define g_IS_IPHONE_5_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 568.0f && [[UIScreen mainScreen] bounds].size.height < 1024.0f
      #define g_IS_IPHONE_4_SCREEN    [[UIScreen mainScreen] bounds].size.height >= 480.0f && [[UIScreen mainScreen] bounds].size.height < 568.0f
      
      
      if(g_IS_IPHONE_5_SCREEN)
      {
          if(g_IS_IPHONE)
              NSLog(@"Hey, this is an iPhone 5 screen!");
          else if(g_IS_IPOD)
              NSLog(@"Hey, this is an iPod 5 screen!");
          else
              NSLog(@"Hey, this is a simulator screen with iPhone 5 screen height!");
      }
      else if(g_IS_IPHONE_4_SCREEN)
      {
          if(g_IS_IPHONE)
              NSLog(@"Hey, this is a lower iPhone screen than 5!");
          else if(g_IS_IPOD)
              NSLog(@"Hey, this is a lower iPod screen than 5!");
          else
              NSLog(@"Hey, this is a lower simulator screen than 5!");
      }
      else if(g_IS_IPAD){
          NSLog(@"Hey, this is an iPad screen!");
      }
      else{
          NSLog(@"Hey, this is an ipad simulator screen!");
      }
      

      干杯!

      【讨论】:

        猜你喜欢
        • 2012-11-16
        • 2016-12-21
        • 1970-01-01
        • 1970-01-01
        • 2012-09-13
        • 2012-09-06
        • 2012-09-14
        • 1970-01-01
        • 1970-01-01
        相关资源
        最近更新 更多