Android的 - 修复屏幕方向1页只(PhoneGap的) [英] Android - Fix screen orientation for 1 page only (phonegap)

查看:151
本文介绍了Android的 - 修复屏幕方向1页只(PhoneGap的)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有固定的屏幕方向的只有我的index.html页面的问题。我想允许该应用除了在主页上旋转。据我所知,添加以下到你的活动 - 安卓screenOrientation =画像旋转停止屏幕

I am having an issue with fixing the screen orientation for my index.html page only. I want to allow the app to rotate except on the home page. I understand that adding the following into you activity - android:screenOrientation="portrait" stops the screen from rotating.

不过,我需要设置此所以它是特定页面。我使用PhoneGap的,因此,需要停止我的网页查看页面。

However, I need to set this so it is page specific. I am using phonegap and therefore, need to stop my web view pages.

我打过电话了以下活动我的清单内 - com.phonegap.droidgap.index.html,然而这并没有工作。

I tried calling the following activity within my manifest - com.phonegap.droidgap.index.html, however this did not work.

可能有人请指点我一下,我怎么可以定义固定方向1页只?

Could someone please advice me as to how I can define the fixed orientation for 1 page only?

在此先感谢

推荐答案

您可以使用此插件的PhoneGap为Android:

You can use this PhoneGap Plugin for Android:

<一个href="https://github.com/champierre/pg-plugin-screen-orientation">https://github.com/champierre/pg-plugin-screen-orientation

和添加到您的index.html页面的onload:

And add to your index.html page onload:

navigator.screenOrientation.set('portrait');

这篇关于Android的 - 修复屏幕方向1页只(PhoneGap的)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆