繁体   English   中英

Android隐藏状态栏,兼容性

[英]Android hide status bar, compatibility

我有以下代码隐藏来自http://developer.android.com/training/system-ui/status.html的状态栏和“ 隐藏状态栏android”

    //hide statut bar
    if (Build.VERSION.SDK_INT < 16) { //ye olde method
        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
                        WindowManager.LayoutParams.FLAG_FULLSCREEN);
    } else { // Jellybean and up, new hotness
        View decorView = getWindow().getDecorView();
        // Hide the status bar.
        int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
        decorView.setSystemUiVisibility(uiOptions);
        // Remember that you should never show the action bar if the
        // status bar is hidden, so hide that too if necessary.
        ActionBar actionBar = getActionBar();
        actionBar.hide();
    }

我在View.SYSTEM_UI_FLAG_FULLSCREEN上收到错误;

在View中似乎不再存在SYSTEM_UI_FLAG_FULLSCREEN

如何解决? 请谢谢你

自API16开始存在。 您必须根据API16(或更高版本)构建应用

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM