Inactive accelerometer, its device orientation must be corrected.
Call this API to fix the orientation: intel.xdk.device.setRotateOrientation(ORIENTATION);after intel.xdk.device.ready.
Full documentation here
Portrait :intel.xdk.device.setRotateOrientation("portrait");
Landscape :intel.xdk.device.setRotateOrientation("landscape");
Both :intel.xdk.device.setRotateOrientation("any");
The following is sample code:
<!DOCTYPE html>
<html>
<head>
<title>XDK</title>
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" />
<script src="intelxdk.js"></script>
<script>
document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);
function onDeviceReady(){
intel.xdk.device.setRotateOrientation('landscape');
intel.xdk.device.hideSplashScreen();
}
</script>
<style>
body {font-family:arial;background-color:white}
</style>
</head>
<body>
<h1>Hello World</h1>
<p>Locked to Landscape</p>
</body>
</html>
source
share