Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Restrict portrait orientation for Ionic App

I am using Ionic, cordova to make an app. I am trying to restrict the orientation of the view to portrait only, I am doing the following in the config.xml file, but it is still not working any ideas?

    <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<widget id="com.ionicframework.ionicucas805049" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
  <name>ionicUcas</name>
  <description>
        An Ionic Framework and Cordova project.
    </description>
  <author email="hi@ionicframework" href="http://ionicframework.com/">
      Ionic Framework Team
    </author>
  <content src="index.html"/>
  <access origin="*"/>
  <preference name="webviewbounce" value="false"/>
  <preference name="UIWebViewBounce" value="false"/>
  <preference name="DisallowOverscroll" value="true"/>
  <preference name="BackupWebStorage" value="none"/>
  <preference name="Orienation" value="portrait" />
  <feature name="StatusBar">
    <param name="ios-package" value="CDVStatusBar" onload="true"/>
  </feature>
</widget>

I have added <preference name="Orienation" value="portrait" /> But no Joy....

like image 257
Sole Avatar asked Jan 29 '15 14:01

Sole


1 Answers

The preference settings in config.xml are case-sensitive and (unfortunately) not consistent.

For this particular setting, it is all lowercase:

<preference name="orientation" value="portrait" />
like image 59
Dawson Loudon Avatar answered Nov 19 '22 08:11

Dawson Loudon