2014-02-09 67 views
0

我有下面的代码隐藏http://developer.android.com/training/system-ui/status.html采取的状态栏和Hide status bar androidAndroid的隐藏状态栏,兼容性

//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的错误;

看来SYSTEM_UI_FLAG_FULLSCREEN在View中不再存在。

如何解决?请谢谢

回答

1

自API16以来就存在。你必须建立你的应用程序对API16(或更高)

+0

好吧,我不知道这个谢谢 – LeSam