Android隐藏标题栏和状态栏的方法

package com.example.layoutdemo;

import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.app.Activity;

public class AnimationActivity extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		//1、隐藏标题栏,在加载布局之前设置(兼容Android2.3.3版本)
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		//2、隐藏状态栏,在加载布局之前设置
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
		setContentView(R.layout.activity_animation);
		
		

	}


}

猜你喜欢

转载自blog.csdn.net/qq15577969/article/details/80620908