我尝试使用下面的代码隐藏我的活动android的状态栏:隐藏Android状态栏中
的OnCreate代码:
// set as full screen
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
protected void onResume() {
super.onResume();
// set as full screen
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
protected void onWindowFocusChanged() {
// set as full screen
View decorView = getWindow().getDecorView();
// Hide the status bar.
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);
}
的状态栏隐藏,直到我选择菜单(下面的代码菜单):
@Override
public boolean onOptionsItemSelected(MenuItem item) {
if (item.getItemId() == R.id.help) {
homehelp = 0; // reset the homehelp logic
homehelp(); // call it to display
}
return false;
}
任何使菜单膨胀的选项都会显示状态栏 - 状态栏会一直保留,直到我使用电源关闭/打开或骑自行车离开我的活动强制执行简历。
有人可以提供一个建议如何保持与菜单通货膨胀/选择隐藏状态栏?
谢谢;
安迪
你可以添加的究竟是什么状态栏你的意思的形象吗? – user2235615 2014-09-28 08:22:15