0

I am trying to lock my ionic screen to not flip completely. Currently I am setting it in my scxml file. I am able to set it to portrait only however with portrait it still flips when if you turn the device upside down. most of the answers I've researched only explain how to set it to portrait, but this does not stop the upside down flip. Here is the line of code I have:

      <send event="setOrientation" to="x-html" data="portrait" />
Flash
  • 924
  • 3
  • 22
  • 44

1 Answers1

0

Add this line in your config.xml file:

<preference name="Orientation" value="portrait"/>

From the documentation:

Default: default Allowed values: default, landscape, portrait Allows you to lock orientation and prevent the interface from rotating in response to changes in orientation. NOTE: The default value means Cordova will strip the orientation preference entry from the platform's manifest/configuration file allowing the platform to fallback to its default behavior. For iOS, to specify both portrait & landscape mode you would use the platform specific value 'all'.

Check the Cordova documentation

manzapanza
  • 6,087
  • 4
  • 39
  • 48