安卓的PhoneGap /科尔多瓦:在应用程序运行时切换全屏模式 [英] Android: phonegap/cordova: switch full screen mode while app is running
本文介绍了安卓的PhoneGap /科尔多瓦:在应用程序运行时切换全屏模式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想我的应用程序运行时全屏模式和普通模式之间进行切换。
I want to switch between full screen mode and normal mode while my app is running.
有任何PhoneGap的插件来为我做这(Android版)?
is there any phonegap plugin to do this for me (Android) ?
如果没有,请告诉我,我怎么能全屏和在java中正常的,所谓的JavaScript之间进行切换。
if no, Please tell me how can I switch between full screen and normal in java, called in javascript.
推荐答案
试试下面的方法。它显示全屏显示。
Try the following method. It displays full screen.
设为全屏如下方法。
调用之前调用此方法super.LoadURL(......);
call this method before "super.LoadURL("....");"
//Fullscreen (No title bar and status bar)
public void setFullscreen() {
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN); //Clean FLAG
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
}
清除 FLAGFLAG_FORCE_NOT_FULLSCREEN。
这是通过DroidGap支持
Clean FLAG "FLAG_FORCE_NOT_FULLSCREEN".
This is supported by DroidGap.
这篇关于安卓的PhoneGap /科尔多瓦:在应用程序运行时切换全屏模式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文