- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've currently tried building for an ipad through the intel xdk and noticed that the orientation settings aren't working. I've set mine to 'landscape', but I still notice that when I turn my ipad around, the app still switches between landscape <-> portrait. Are there any plans to fix this?
I was also wondering how the status on developing for only ipad apps were going (currently only able to develop universal apps, which makes it impossible to develop apps for only ipad) - I asked the question about a year ago and again last month, but as of now, an update doesn't seem to be on the way.
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The portrait/landscape only sets the initial orientation of the app (on start up). You need to use javascript to lock it to landscape if you want it to remain in landscape at all times.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi John
Sorry to reopen this thread, but I've this same issue. I'm trying to lock the orientation to landscape and I can't. I know about the solution to cli 5 but I need to build the app in cli4 because I'm using a plugin that only works in this way.
This solution that you/intel provided still works?
If yes, where I have to include this code?
//lock in "portrait" orientation
intel.xdk.device.setRotateOrientation("portrait");
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You can include the set orientation code after the device ready event - In your code ondeviceready() or onappready() function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Swati
I included this code in the index.html
<script>
document.addEventListener("intel.xdk.device.ready", onDeviceReady, false);
function onDeviceReady(){
// set orientation
intel.xdk.device.setRotateOrientation('landscape');
// intel.xdk.device.setRotateOrientation('portrait');
// intel.xdk.device.setRotateOrientation('any');
intel.xdk.device.hideSplashScreen();
}
</script>
After:
<script src="intelxdk.js"></script>
But didn't work. It's not right?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
My application needs to stay in panorama mode but only appears in portrait. I had specified the landscape option in C2 and XDK, and included the script also, but nothing changes. I really need some assistance about this issue. I started my tries to fix this problem more than week ago. Please, some help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've to maintain both deviceready event listeners
<script src="cordova.js"></script>
<!-- The runtime script. You can rename it, but don't forget to rename the reference here as well.
This file will have been minified and obfuscated if you enabled "Minify script" during export. -->
<script src="c2runtime.js"></script>
<script>
jQuery(window).resize(function() {
cr_sizeCanvas(jQuery(window).width(), jQuery(window).height());
});
document.addEventListener("deviceready", function ()
{
window["c2iscordova"] = true;
// Create new runtime using the c2canvas
cr_createRuntime("c2canvas");
document.addEventListener("pause", function() {
cr_setSuspended(true);
}, false);
document.addEventListener("resume", function() {
cr_setSuspended(false);
}, false);
}, false);
</script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Check out this FAQ: https://software.intel.com/en-us/xdk/faqs/cordova#app-orientation

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page