我正在使用 Ionic、cordova 制作应用程序。我试图将 View 的方向限制为仅纵向,我在 config.xml 文件中执行以下操作,但它仍然不起作用任何想法?
<?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>
我已添加<preference name="Orienation" value="portrait" />
但没有喜悦......
最佳答案
config.xml 中的首选项设置区分大小写,并且(不幸的是)不一致。
对于这个特定的设置,它全部是小写:
<preference name="orientation" value="portrait" />
关于cordova - 限制 Ionic App 的纵向方向,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28217275/