ActionBarSherlock全屏

时间:2012-10-16 14:48:47

标签: android android-layout

有没有办法隐藏状态栏并保持操作栏可见?

1 个答案:

答案 0 :(得分:13)

是的,有。 您应该在FLAG_FULLSCREEN活动方法中设置onCreate

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
            WindowManager.LayoutParams.FLAG_FULLSCREEN);
    setContentView(R.layout.activity_main);
}