我的环境使用的是Sencha-touch和PhoneGap。我可以用垂直锁定方向吗?我不希望用户使用水平方向进行操作。
launch: function() {
// Destroy the #appLoadingIndicator element
Ext.fly('appLoadingIndicator').destroy();
// Initialize the main view
Ext.Viewport.add(Ext.create('ebook.view.Main'));
},我需要在午餐功能上添加一些控制或配置吗?或者我需要将控件添加到main.js。我的目的是希望将方向锁定在“垂直方向”上。有谁能帮我吗。谢谢。
其他参考:我在"package.json“上找到了下面的代码,我尝试删除”landscapeLeft“和”landscapeRight“并重新构建它,得到了同样的结果。我不能锁定用户方向。
/**
* @cfg {Array[String]} orientations
* @required
* This is orientations that this application can run.
*/
"orientations": [
"portrait",
"landscapeLeft",
"landscapeRight",
"portraitUpsideDown"
]发布于 2013-03-19 06:54:31
你应该在PhoneGap的config.xml中这样做
< preference name="orientation" value="portrait" />发布于 2013-12-27 00:21:59
在安卓和使用Phonegap3.3的系统中,config.xml中的方向偏好似乎被忽略了。对我有效的一种解决方法是修改AndroidManifest.xml,并为每个活动标记添加属性android:screenOrientation="portrait“。看起来很管用。
发布于 2013-03-12 19:08:07
我不确定您是在哪个平台上开发的。我使用Sencha+PhoneGap的经验主要是在iOS上。
因为Sencha生成的所有web内容都将被包装在一个视图控制器中(这是phonegap项目的机制)。您可以通过删除项目.plist中的所有横向选项来简单地锁定方向。
它在我的一个演示中运行得很好。
https://stackoverflow.com/questions/15355752
复制相似问题