1. 方法1:AndroidManifest.xml 里,Activity的 android:theme 指定为"@android:style/Theme.NoTitleBar.Fullscreen"

示例:
<application
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen">
<activity
android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

2. 方法2: 在onCreate()里指定No title
要加入:

/*set it to be no title*/
requestWindowFeature(Window.FEATURE_NO_TITLE);
/*set it to be full screen*/
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);


示例:
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
/*set it to be no title*/
requestWindowFeature(Window.FEATURE_NO_TITLE);

/*set it to be full screen*/
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

setContentView(R.layout.activity_main);

更多相关文章

  1. 浅谈Java中Collections.sort对List排序的两种方法
  2. Python list sort方法的具体使用
  3. python list.sort()根据多个关键字排序的方法实现
  4. Android(安卓)软键盘遮挡三种解决方案
  5. Android(安卓)Timer类的使用
  6. Android(安卓)和 H5 互调
  7. Android获取本机Mac地址及IP地址的方法
  8. Android(安卓)4.0 ICS SystemUI浅析——SystemUI启动流程
  9. Android(安卓)远程链接 daemon not running 解决方法

随机推荐

  1. Android(安卓)PATH类动态绘制
  2. 关闭程序
  3. android设置保持窗口常亮
  4. Android(安卓)Okhttp的基础使用版
  5. Android(安卓)滑动开关控件
  6. Version Code 版本设置
  7. android 开源项目(城市定位)
  8. Android中下载文件的使用
  9. Android(安卓)学习之- 单选按钮、复选框
  10. Android(安卓)Applications Tutorial 22.