Lock device orientation

  • 2
  • Idea
  • Updated 5 years ago
  • Implemented
Create a Phonegap Build plugin lock the orientation of the device to either "landscape" or "portrait" orientation, for all oses. As AppMobi.device.setRotateOrientation(orientation); do: http://www.html5dev-software.intel.co...
Photo of Lorenzo De Tomasi

Lorenzo De Tomasi

  • 15 Posts
  • 0 Reply Likes

Posted 7 years ago

  • 2
Photo of Hyginus Ugwumba

Hyginus Ugwumba

  • 1206 Posts
  • 42 Reply Likes
Hi Lorenzo,

There is not plugin that I know which does this function, however you can set your orientation to either portrait or lanscape inside the config.xml file.

for more information see config doc.
https://build.phonegap.com/docs/config-xml

Thanks
Hyginus
Photo of alfonsofonso

alfonsofonso

  • 8 Posts
  • 1 Reply Like
I'm afraid this
preference name="orientation" value="portrait"
is not working on nexus 5
Photo of j0sh

j0sh

  • 1 Post
  • 0 Reply Likes
Neither is working on xperia z1
Photo of Simon Chen

Simon Chen

  • 6 Posts
  • 0 Reply Likes
Did anyone the orientation lock working? I've changed the config.xml and to portrait as alfonsofonso has done and it doesn't work.
Photo of ismael jimoh

ismael jimoh

  • 4116 Posts
  • 192 Reply Likes
Hi Simon,

You can specify orientation using this new add on specified in this link.

Hope it helps.


Photo of Shane Parsons

Shane Parsons

  • 15 Posts
  • 0 Reply Likes
Im still having this issue.. nothing in the link in the previous post has helped me.

Any ideas?
Photo of Shane Parsons

Shane Parsons

  • 15 Posts
  • 0 Reply Likes
Scratch that, I had accidentally spelt "portrait" as "portait".. took days to find that mistake.