Software Archive
Read-only legacy content
17061 Discussions

Orientation doesnt work on iOS

Leo_N_Ng_
New Contributor I
879 Views

My game worked well with Android exported. Then I exported it to iOS, everythings is good except Orientation . I tried to change the Build option and added all Plugins to my project but It didnt work. I also put the code "intel.xdk.device.setRotateOrientation("landscape");" to everywhere of my source file without working. Im making game by Contruct 2 software. Every else exporters dont work well with my game. I can use only XDK. I tested my game on iPhone 5  OS 8. Please help me to fix this issue. Thank you.

 

0 Kudos
1 Solution
PaulF_IntelCorp
Employee
879 Views

Beginning with CLI 5, another solution is to use the following preference in your intelxdk.config.additions.xml file:

<platform name="ios">
    <!-- so iPhone and iPad rotate freely (CLI 5.1.1 and above) -->
    <!-- values include "default", "landscape" and "portrait" -->
    <!-- "default" means "portrait" for iPhone and "free" for iPad -->
    <preference name="Orientation" value="all" />
</platform>

See https://cordova.apache.org/docs/en/5.1.1/config_ref/index.html for more information.

View solution in original post

0 Kudos
8 Replies
Leo_N_Ng_
New Contributor I
879 Views
0 Kudos
Jason_C_4
Beginner
879 Views

Hi... :)

I wonder if my ios orientation symptom is the same: though I specify landscape via Intel Xdk [such as 1) 'build settings: orientation' and 2) 'launch icons and splash screens: orientation], I still get portrait on my ios device.  

Will your kind lead to 'Intel XDK Orientation Sample' resolve my situation?  If so, can there be more explaination, since I'm a noob to patching code?  ;)  (Interestingly enough, phonegap-build does honor my landscape choice.)

Thx in advance.  :)  Jason

0 Kudos
PaulF_IntelCorp
Employee
879 Views

There is a known issue regarding iOS orientation and Cordova. An interim fix is available, see this forum thread: https://forums.html5dev-software.intel.com/viewtopic.php?f=29&t=7830#p31421

0 Kudos
Jason_C_4
Beginner
879 Views

Paul Fischer (Intel) wrote:

There is a known issue regarding iOS orientation and Cordova. An interim fix is available, see this forum thread: https://forums.html5dev-software.intel.com/viewtopic.php?f=29&t=7830#p31421

Thanks Paul for the helpful link.  

Since my goal is to have 'landscape', should I use everything in their solution, except replace their solution of ' 'UIInterfaceOrientationPortrait' with 'UIInterfaceOrientationLandscapeRight'?  

Special Regards... :)  Jason

0 Kudos
PaulF_IntelCorp
Employee
879 Views

You'll have to look up the names on the Apple developer site, I don't know what they are, off-hand. Also, the plugin referenced in this thread might help: https://forums.html5dev-software.intel.com/viewtopic.php?f=34&t=8974

0 Kudos
PaulF_IntelCorp
Employee
880 Views

Beginning with CLI 5, another solution is to use the following preference in your intelxdk.config.additions.xml file:

<platform name="ios">
    <!-- so iPhone and iPad rotate freely (CLI 5.1.1 and above) -->
    <!-- values include "default", "landscape" and "portrait" -->
    <!-- "default" means "portrait" for iPhone and "free" for iPad -->
    <preference name="Orientation" value="all" />
</platform>

See https://cordova.apache.org/docs/en/5.1.1/config_ref/index.html for more information.

0 Kudos
Romain_C_1
Beginner
879 Views

Hi,

Do someone know if this problem has been solved ? And what to do ? 

Thank you

0 Kudos
Nhat_N_
Beginner
879 Views

It is solved. I'm using the lastest version of XDK, and never meet this problem again ^ ^ 

 

0 Kudos
Reply