Quantcast
Channel: Android*
Viewing all articles
Browse latest Browse all 531

setRotateOrientation Method

$
0
0

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");
            

Version:

This method is available in appMobi Version 3.0.0

English

Viewing all articles
Browse latest Browse all 531


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>