Android中显示状态栏在PhoneGap的应用程序(如prevent全屏) [英] Show status bar in Android in PhoneGap app (ie prevent fullscreen)

查看:150
本文介绍了Android中显示状态栏在PhoneGap的应用程序(如prevent全屏)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个PhoneGap的3.0.0应用程序。 我的应用程序涵盖了状态栏(时钟,接收信息等方面的东西)。因为我不是一个全屏的游戏,这是不可取的。

I have a phonegap 3.0.0 application. My application covers the status bar (the thing with the clock, reception info, etc). Since i'm not a full screen game, this is not desirable.

我相信它的运行是一个全屏幕的应用程序。

I believe it's running as a "Full Screen" app.

我发现帖子在这里栈做相反(即让一个应用程序去全屏幕),并没有什么建议的倒数。我不知道有什么东西在PhoneGap的或者可能的PhoneGap CLI,我用来创建项目,因为我的应用程序全屏显示改变。

I've found posts here on stack to do the opposite (ie make an app go full screen) and did the inverse of what was suggested. I'm wondering if something changed in PhoneGap or perhaps the PhoneGap CLI that I used to create the project because my app is showing fullscreen.

我尝试这样做:

  public void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);

        super.setIntegerProperty("splashscreen", R.drawable.splash);

        getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);

        super.loadUrl(Config.getStartUrl(), 10000);
    }

其中明确告诉它不能在全屏模式下....但它仍然显示全屏。

Which explicitly tells it to NOT be in full screen mode.... but it still shows up full screen.

推荐答案

我想它了。

在闪屏插件,必须将其设置为全屏。 通过调用 clearFlags 方法 super.loadUrl 之后,一旦应用程序加载状态栏显示出来。

The Splashscreen plugin must be setting it to fullscreen. By calling the clearFlags method AFTER super.loadUrl, once the app loads the status bar shows up.

@Override
public void onCreate(Bundle savedInstanceState)
{
    super.onCreate(savedInstanceState);
    super.setIntegerProperty("splashscreen", R.drawable.splash);
    super.loadUrl(Config.getStartUrl(), 10000);

    getWindow().clearFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
}

这篇关于Android中显示状态栏在PhoneGap的应用程序(如prevent全屏)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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