弹出dialog时,隐藏navigation bar的方法



http://stackoverflow.com/questions/23520892/unable-to-hide-navigation-bar-during-alertdialog-logindialog(方法来源)

放在自定义dialog中即可

@Override
public void onStart() {
super.onStart();
Window window = this.getWindow();

//Window window = getDialog().getWindow();如果是在activity中则用这段代码
window.setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,WindowManager.LayoutParams.FLAG_FULLSCREEN);
//window.requestWindowFeature(Window.FEATURE_NO_TITLE); 用在activity中,去标题
int uiOptions =View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
	|View.SYSTEM_UI_FLAG_LAYOUT_STABLE
	|View.SYSTEM_UI_FLAG_HIDE_NAVIGATION
	|View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
	|View.SYSTEM_UI_FLAG_IMMERSIVE
	|View.SYSTEM_UI_FLAG_FULLSCREEN
window.getDecorView().setSystemUiVisibility(uiOptions);
}





你可能感兴趣的:(安卓,android,ui)