Fix Screen Orientation

Fix Screen Orientation
0

#1

Hello

I haven’t found the answer, please help.

I wonder is there any universal method to fix screen orientation (for at least both iOS and Android) ?

Or how to do it avoiding modifying cocos2d-x sources ?

Now I use 2.2 version
Thanks in advance.


#2

Is there any possibility to fix screen orientation for just one multi-platform project ?


#3

What do you mean by “fixing”?
If you need to switch from landscape to portrait orientation, then you have to do that in the project settings for each platform. For instance, for Android:

<activity ...
          android:screenOrientation="portrait"
          ...>
    ...
</activity>

For iOS you can do that in XCode.


#4

By fixing I mean disabling of screen orientation changing ability. So as I understood there is no universal way of doing it for most platforms.

Thank you for your reply.