Software Archive
Read-only legacy content
17061 Discussions

force landscape orientation

sam_w_1
Beginner
863 Views

What is the best way to force landscape orientation?  (I am developing for microsoft surface )

It looks like the following is deprecated - what is the current method?

intel.xdk.device.setRotateOrientation("portrait");

 

 

 

 

 

0 Kudos
3 Replies
Anusha_M_Intel1
Employee
863 Views

Please refer to our orientation sample that ships with the XDK. 

New Projects -> Samples & Demos -> HTML5 + Cordova -> Orientation Sample

You can also refer to the Cordova Orientation plugin that uses the device's compass to sense the direction the device is pointed: https://github.com/apache/cordova-plugin-device-orientation

0 Kudos
Chris_P_Intel
Employee
863 Views

If you simply want your app to always be one orientation or another, use the Build setting called "Orientation" in the Projects pane

0 Kudos
Anusha_M_Intel1
Employee
863 Views

Good point. Since you say you only need landscape orientation and do not need the UI to change according to orientation detected, Chris's suggestion should work. 

0 Kudos
Reply