[iOS] how to lock orientation to landscape only in Enterprise build?

Hi,

I did what you said Vlads,

it works thanks  :slight_smile:

No more portrait!

But I’ve got only landscapeLeft which works, even if I specified the both (UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight)

Any idea?

Thanks again

Best

Olivier

Hey, [member=‘oromanetti’].

Try syncing with build.settings.

Thanks Vlads

I did it

here my build.settings :

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

and here a part of my plist :

\<key\>CoronaViewSupportedInterfaceOrientations\</key\> \<array\> \<string\>UIInterfaceOrientationLandscapeLeft\</string\> \<string\>UIInterfaceOrientationLandscapeRight\</string\> \</array\>

only landscapeLeft works…

What does your UISupportedInterfaceOrientations say? Try removing CoronaViewSupportedInterfaceOrientations entry and selecting all orientations in target properties (or UISupportedInterfaceOrientations)

My UISupportedInterfaceOrientations :

\<key\>UISupportedInterfaceOrientations\</key\> \<array\> \<string\>UIInterfaceOrientationLandscapeRight\</string\> \<string\>UIInterfaceOrientationLandscapeLeft\</string\> \</array\>

I’ve got this thing too in my plist

<key>UISupportedInterfaceOrientations~ipad</key>

<array>

<string>UIInterfaceOrientationLandscapeLeft</string>

<string>UIInterfaceOrientationLandscapeRight</string>

</array>

Still doesn’t work? I just downloaded latest version of enterprise, copied example app (deleted everything from it), and just edited build settings. I got app which works in both landscape modes in iOS simulators, bot iPad and iPhone. I can’t reproduce the problem. I don’t have anything related to orientation in plist, or in plist section of build.settings. Only thing I have in build.settings is

[lua]settings =
{
orientation = {
default = “landscapeLeft”,
supported = { “landscapeLeft”, “landscapeRight”},
}
}[/lua]

Here is my project https://dl.dropboxusercontent.com/u/2658771/landscapeOrientationTest.zip (it will unpack in folder App)

@oromanetti:

make sure your build target is using the plist file you make changes in.

I use several targets and sometimes forget to change all of the plist files.

Just a thought, since your settings look correct.

Thanks Vlads, thanks Kristian,

@Kristian : I checked, my build target is using the plist file I make changes in.

@Vlads : I downloaded your project thanks.

But how do you know that it works for both landscapes as there is no objects on the screen?

I created a newText object to verify, and it doesn’t work for me.

The newText object doesn’t follow the orientation. Even worse, newText is written as if we were on a portrait mode :frowning:

See below a screenshot

here the new main.lua

local r = display.newRect( display.contentCenterX, display.contentCenterY, display.contentWidth, display.contentHeight ) r.stroke = {1,0,0} r.strokeWidth = 20 local options = { text = "Test Test Test", fontSize = 60, align = "center" --new alignment parameter } local label = display.newText(options) label:setFillColor(0) label.x = display.contentCenterX label.y = display.contentCenterY

@oromanetti

just to make sure: are you using the latest corona?

Sorry for dump questions, but sometimes when issue becomes so weird, it’s the simplest things that we forget about [well I do!].