This function will lock the orientation of the device to either "landscape" or "portrait" orientation.
intel.xdk.device.setRotateOrientation(orientation);
Description:
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.
Available Platforms:
- Apple iOS
- Google Android
- Microsoft Windows 8 - BETA
- Microsoft Windows Phone 8 - BETA
Parameters:
orientation: A specific string. Either "landscape" or "portrait" to specify which orientation to use. Pass a string of "any" to allow the application to rotate freely again.
Example:
//lock in "portrait" orientation
intel.xdk.device.setRotateOrientation("portrait");
Version:
This method is available in appMobi Version 3.0.0
English