Corona SDK:iPhone 5调整

Eye*_*all 2 scripting lua coronasdk iphone-5

我在创建移动应用程序时使用以下config.lua文件.

构建到设备时,屏幕将无法调整到iPhone5.但是,它会在电晕提供的模拟器上运行时进行调整.

你能告诉我问题是在这个文件中,还是在于它取决于其他一些实现问题.

谢谢!

/ S

local isTall = ( "iPhone" == system.getInfo( "model" ) ) and ( display.pixelHeight > 960 )

 -- iPad Configuration
 if ( string.sub( system.getInfo("model"), 1, 4 ) == "iPad" ) then
   application =
   {
      content =
      {
         width = 360,
         height = 480,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

   -- iPhone5 Configuration
   elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" and display.pixelHeight > 960 ) then
   application =
   {
      content =
      {
         width = 320,
         height = 568,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

   -- iPhone 3,4 and Older iPod Touch
   elseif ( string.sub( system.getInfo("model"), 1, 2 ) == "iP" ) then
   application =
   {
      content =
      {
         width = 320,
         height = 480,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   } 

   -- Android, Kindle Fire, and Nook
   elseif ( display.pixelHeight / display.pixelWidth > 1.72 ) then
   application =
   {
      content =
      {
         width = 320,
         height = 570,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

else
   application =
   {
      content =
      {
         width = 320,
         height = 512,
         scale = "letterBox",
         xAlign = "center",
         yAlign = "center",
         imageSuffix =
         {
            ["@2x"] = 1.5,
            ["@4x"] = 3.0,
         },
      },
   }

end
Run Code Online (Sandbox Code Playgroud)

Eye*_*all 12

解决了!

显然,我认为这根本不清楚,需要添加一个名为"Default-568h@2x.png"的文件(在应用程序的根目录下),该文件告诉设备进入iPhone5模式!

此文件应为尺寸为640x1136的png

更多信息可在以下网址找到:

在"支持高级应用程序"下