Android实现隐藏状态栏和标题栏

隐藏标题栏需要使用预定义样式:android:theme=”@android:style/Theme.NoTitleBar”.
隐藏状态栏:android:theme=”@android:style/Theme.NoTitleBar.Fullscreen”.

Android实现隐藏状态栏和标题栏_第1张图片



  
    
      
        
        
      
    
 
  
  
 


@Override
public void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  // hide titlebar of application
  // must be before setting the layout
  requestWindowFeature(Window.FEATURE_NO_TITLE);
  // hide statusbar of Android
  // could also be done later
  getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
      WindowManager.LayoutParams.FLAG_FULLSCREEN);
  setContentView(R.layout.main);
  text = (EditText) findViewById(R.id.EditText01);
 
}

以上所述就是本文的全部内容了,希望大家能够喜欢。

你可能感兴趣的:(Android实现隐藏状态栏和标题栏)