【发布时间】:2015-03-28 19:55:10
【问题描述】:
我正在使用 Ionic、cordova 来制作应用程序。我试图将视图的方向限制为仅纵向,我在 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" />
但没有喜悦....
【问题讨论】:
-
这是区分大小写的,试试:
<preference name="orientation" value="portrait" /> -
感谢 Dawson,成功了。
-
您现在也可以通过编程方式执行此操作:gajotres.net/…