1. 用代碼的方法(注必須在setContentView之前設置):
- @Override
- public void onCreate(Bundle savedInstanceState) {
- super.onCreate(savedInstanceState);
-
- // remove title bar
- this.requestWindowFeature(Window.FEATURE_NO_TITLE);
-
- // full screen
- this.getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
- WindowManager.LayoutParams.FLAG_FULLSCREEN);
-
- setContentView(R.layout.main);
- }
2. 在配置文件中設置相應的Activity屬性:
Android:theme="@android:style/Theme.NoTitleBar.Fullscreen"