【问题标题】:Kendo UI + Cordova. Orientation issue.剑道 UI + Cordova。方向问题。
【发布时间】:2014-07-11 21:07:05
【问题描述】:

我正在使用 Kendo UI(Appbuilder、cordova)开发 HTML5\JS 应用程序。 这是问题所在: 如何手动设置方向(横向\纵向)。 谢谢!

【问题讨论】:

  • 你的意思是你想让你的应用总是只显示在一个方向上,还是你的意思是你想在任何时候强制一个方向或另一个方向即使设备没有以这种方式旋转也需要时间?
  • 我希望我的应用始终以横向显示。

标签: cordova mobile kendo-ui screen-orientation telerik-appbuilder


【解决方案1】:

在 AppBuilder 的属性 -> 常规部分中,您可以选择支持的设备方向。只需取消选中“纵向”,您的应用将仅在横向模式下运行。

【讨论】:

  • 如何通过配置或在源代码中做到这一点?
【解决方案2】:

如果您不想在 Rob 回答时切换 AppBuilder 中的设置,您可以在 Cordova config.xml file 中编辑它:

<preference name="Orientation" value="landscape" />

此 Javascript 可能有效 (taken from here):

function shouldRotateToOrientation(interfaceOrientation) {
    return (3 === interfaceOrientation);
}

否则,请查看这些可能的重复项:

Cordova iOS Change Screen Orientation To Landscape on a Single Page

Cordova 3.x forcing screen orientation at run-time IOS

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多