This function will lock the orientation of the device to either "landscape" or "portrait" orientation.
This function will lock the orientation of the device to either "landscape" or "portrait" orientation. The orientation will be locked based on which specific string is passed to the function. Passing “portrait” will lock the application into portrait orientation and passing “landscape” will lock the application into landscape orientation. If the current orientation is not the specified orientation, the device will lock in the specified orientation only once the device is oriented in that position.
To unlock the orientation, set the orientation to an empty string.
- Apple iOS
- Google Android
- Microsoft Windows 8 - BETA
- Microsoft Windows Phone 8 - BETA
//lock in "portrait" orientation intel.xdk.device.setRotateOrientation("portrait");