Android(安卓)全屏显示
全屏显示主要是设置下面这两个属性:
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR,
WindowManager.LayoutParams.TYPE_STATUS_BAR);
注:以上是使用android-sdk-windows-1.1_r1版本的SDK,其它版本参考相应的Documens
下面给出一个简单的例子:
package com.android.hello;
import android.app.Activity;
import android.os.Bundle;
import android.view.Window;
import android.view.WindowManager;
import android.widget.TextView;
public class HelloAndroid extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
this.getWindow().setFlags(WindowManager.LayoutParams.TYPE_STATUS_BAR,
WindowManager.LayoutParams.TYPE_STATUS_BAR);
TextView tv = new TextView(this);
tv.setText("Hello Android!!");
setContentView(tv);
}
}
更多相关文章
- Android(安卓)App第一次启动或者更新或第一次启动
- 今天玩玩Android(安卓)-==-- 了解一下
- Android保持屏幕常亮的方法总结
- android手机状态解释,比如android.os.Build.VERSION.SDK
- android Manifest merger failed : Attribute application@allow
- android studio 配置Kotlin报错Error:Cause: org.gradle.api.int
- 获取android手机信息
- android XML文件序列化
- Android控件布局属性大全