This is a migrated thread and some comments may be shown as answers.

Force orientation portrait

3 Answers 301 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Andreas
Top achievements
Rank 1
Andreas asked on 01 Feb 2013, 07:54 AM
Hi!

Is it possible to force the orientation to be portrait, not switching to landscape when user flips the phone? We target iPhone 4-5.

3 Answers, 1 is accepted

Sort by
0
Kamen Bundev
Telerik team
answered on 04 Feb 2013, 10:09 AM
Hello Andreas,

This is not possible from within a web application/page at least until the Screen Orientation API is complete and implemented. Instead you can do it in PhoneGap or Icenium, using config.xml and Project Properties respectively.

Kind regards,
Kamen Bundev
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
0
Andreas
Top achievements
Rank 1
answered on 04 Feb 2013, 12:17 PM
Thank you for the reply.

Yes, we are using Icenium and have looked into setting the propertiy for orientation, "Supported interface orientation" and we did set only portrait. The Device Simulator in Icenium respects this and its working fine, however when running on a device (iPhone4) the phone does not respect that setting. Do you have any thoughts on that?

Regarding the config XML file, that file is not included default in an Icenium Kendo project, and when adding a new file no such option is avaliable (only html, css, javascript). Do we just add a file, naming it config.xml into our project and follow the documentation?


Thanks!
0
Accepted
Jordan
Telerik team
answered on 04 Feb 2013, 12:52 PM
Hi Andreas,

Config.xml is intended only for PhoneGap Build.

If you set orientation in Icenium it will work in simulator and real device when deployed using provision or App Store.

You probably using Icenium Ion our stand alone container for applications and this deployment option do not support orientation locking right now.

You can also define a global function like this (for iOS) : 

function shouldRotateToOrientation(orientation) {
alert(orientation); //remove when not needed
return
orientation == 0;
}

Regards,
Jordan
the Telerik team
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
Tags
General Discussions
Asked by
Andreas
Top achievements
Rank 1
Answers by
Kamen Bundev
Telerik team
Andreas
Top achievements
Rank 1
Jordan
Telerik team
Share this question
or