Hello,
I have an app for android and iOS.
On android everything is fine (I developed on Windows).
I use landscapeRight orientation.
Now I try to build for iOS.
On the simulator, all devices show correct, perfect full content area, no black areas.
But it has unexpected black areas on left and right sides on real iPhone 5.
Then I tried iPhone4 and iPad, both show full content area without black areas.
So I am confused, the screen on real iPhone 5 displays like iPhone 4 but with black areas on left and right side. And its display.screenOriginY seems wrong so my UI on the right area is moved a little(see the attachments: screenshot on simulator and device).
I don’t bother to use to many config, I just set width = 540, height = 960, optimized for 16:9/androids.
But the ratio is much more closer to iPhone5 than iPhone4.
What bothers me is I don’t have a mac, I only use it when I build.
So I can not try some more test now.
But it is not supposed to act differently like that.
my content width = 540, height = 960,
And I have a larger background image (even fits for pads.)
It should not have any black areas. And it only on iPhone5 devices.
my config.lua:
application =
{
content = {
width = 540,
height = 960,
scale = “letterbox”,
fps = 30,
},
}
build.setting:
settings = {
orientation =
{
default = “landscapeRight”,
supported = { “landscapeRight”, }
},
iphone =
{
plist =
{
UIStatusBarHidden = true,
CFBundleIconFiles =
{
“icon/Icon.png”,
“icon/Icon@2x.png”,
“icon/Icon-60.png”,
“icon/Icon-60@2x.png”,
“icon/Icon-72.png”,
“icon/Icon-72@2x.png”,
“icon/Icon-76.png”,
“icon/Icon-76@2x.png”,
“icon/Icon-Small.png”,
“icon/Icon-Small@2x.png”,
“icon/Icon-Small-40.png”,
“icon/Icon-Small-40@2x.png”,
“icon/Icon-Small-50.png”,
“icon/Icon-Small-50@2x.png”,
},
},
},
android =
{
versionCode = “1.0”,
– Android permissions
androidPermissions =
{
},
}
}
On windows simulator, if I select show as iPhone5, the following output shows:
print(display.pixelWidth, display.pixelHeight)
640 1136
print(display.contentWidth, display.contentHeight)
960 540
print(display.viewableContentWidth, display.viewableContentHeight)
960 540
print(“Scale Factor=”… display.pixelHeight / display.actualContentWidth)
1.18333
print(“Scale Factor=”… display.pixelWidth / display.actualContentHeight)
1.18333
print(“screenOriginX=”… display.screenOriginX)
-0
print(“screenOriginY=”… display.screenOriginY)
-0
But on devices, it act differently and has black areas on both sides.
I don’t know how to correct this.
Any suggestion is appreciated.