App always starts with portrait canvas on iPad with all orientations enabled (?)

Since I don’t have an iPad, I’m using the iOS simulator to test this since Corona’s doesn’t let you choose the initial orientation. I’ve tested this on build 777 with no luck… zing!

The problem I’m having is difficult to describe so here is a video of it using a simple test app that reads the orientation at start and on orientation events. When launching with the iPad already in an orientation other than portrait, it will start with everything right-side-up with respect to the iPads orientation, but with the canvas having the wrong dimensions and system.orientation always reading ‘portrait’ — but only for the first frame. After that an orientation event fires and then all is well.

The problem with this is there’s an ugly flash of everything out of whack before it rights itself, and since there seems to be no way to find out the actual device orientation until after the first frame has passed, it’s impossible to make a workaround short of just blacking out the screen until everything is right. As I understand it, the iPad ignores the default orientation and will always try to start the app in the device’s current orientation as long as it is one that is listed as supported, but that doesn’t seem to be the case here. I’ve been all over the docs and forums and can’t seem to find anyone having this issue, even though it seems like it’d be pretty hard to miss during testing if your app is multi-orientation aware.

I’d be happy if someone could point out the simple mistake I must be making… really!

Here is my build.settings

[lua]settings =
{
orientation =
{
default = “portrait”,
supported =
{
“portrait”,“landscapeRight”,“landscapeLeft”,“portraitUpsideDown”
},
},
iphone =
{
plist =
{
UIApplicationExitsOnSuspend = false,
UIPrerenderedIcon = false,
},
},
}[/lua]

And here is the config.lua

[lua]application =
{
content =
{
fps = 60,
width = 320,
height = 480,
scale = “letterbox”,
imageSuffix =
{
["@2x"] = 2,
},
}
}[/lua]

And finally the code for the test app in the video above

[lua]local bg = display.newImageRect( “beach.jpg”, 480, 360 )
bg.x, bg.y = display.contentWidth / 2, display.contentHeight / 2

local started = display.newText(“Started: " … system.orientation … " (” … display.contentWidth … “x” … display.contentHeight … “)”, 0, 0, native.systemFont, 18)
started:setReferencePoint(display.CenterReferencePoint)
started.x, started.y = display.contentWidth / 2, display.contentHeight / 2 - 10
started:setTextColor(255, 255, 0)

local current = display.newText(“Current: " … system.orientation … " (” … display.contentWidth … “x” … display.contentHeight … “)”, 0, 0, native.systemFont, 18)
current:setReferencePoint(display.CenterReferencePoint)
current.x, current.y = display.contentWidth / 2, display.contentHeight / 2 + 10
current:setTextColor(255, 255, 255)

function changedOrientation ( event )
current.text = “Current: " … system.orientation … " (” … display.contentWidth … “x” … display.contentHeight … “)”
started.x, started.y = display.contentWidth / 2, display.contentHeight / 2 - 10
current.x, current.y = display.contentWidth / 2, display.contentHeight / 2 + 10
bg.x, bg.y, bg.rotation = display.contentWidth / 2, display.contentHeight / 2, event.delta
transition.to( bg, { time = 280, transition = easing.inOutQuad, rotation = 0} )
end

Runtime:addEventListener( “orientation”, changedOrientation );[/lua]

Any help is appreciated!! [import]uid: 32900 topic_id: 24616 reply_id: 324616[/import]