2

I am using the following config.lua file when creating my mobile application.

The screen will not adjust to iPhone5 when building to device. It will, however, adjust when running on the simulator that corona provides.

Can you tell me if the problem lies in this file, or if it depends on some other implementation issue.

Thanks!

/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
4

2 回答 2

12

解决了!

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

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

更多信息可以在以下位置找到:

在“支持 tall 应用程序”下

于 2013-04-23T12:13:37.123 回答
0

如果您正在构建横向模式,例如

orientation = {
    default = "landscapeLeft",
    content = "landscapeLeft",
    supported = { "landscapeRight", "landscapeLeft"}
},

使用尺寸为 1136x640 的“Default-568h@2x.png”,否则会出现问题。

于 2013-04-26T12:35:09.803 回答