cordova - Sencha-touch如何锁定方向?

标签 cordova sencha-touch phonegap-plugins

我的环境使用的是Sencha-touch & PhoneGap。我可以用 Vertical 锁定方向吗?我不希望用户使用水平方向进行操作。

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"
]

最佳答案

你应该在 PhoneGap 的 config.xml 中这样做

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

关于cordova - Sencha-touch如何锁定方向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15355752/

相关文章:

javascript - Sencha touch 应用加载掩码

javascript - Sencha Touch - 重新加载/刷新应用程序后商店清空

sencha-touch - 主题 Sencha 触摸错误 : File to import not found or unreadable: sencha-tou ch/default/all

android - 如何在 Android 中的 PhoneGap 的 CordovaWebView 之上覆盖原生 View ?

android - 关闭由 IntelXDK android build 构建的 android 混合应用程序

iphone - 如何在 iOS 版 Phone Gap 中使用 WSDL Web 服务?

javascript - 如何打包Node Web应用程序以便可以将其安装为本地应用程序?

android - 多个电话/设备之间的通信

android - Phonegap 视频插件?

android - 移动共享对话框上的 Facebook 共享按钮被切掉