setRotateOrientation Method

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:

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");
            
For more complete information about compiler optimizations, see our Optimization Notice.