在android中,有的时候要做一个无标题的窗口,包括没状态栏的,有两种方法实现:

1 在XML配置文件中:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.vogella.android.temperature"
android:versionCode="1"
android:versionName="1.0">
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:name=".Convert"
android:label="@string/app_name"
android:theme="@android:style/Theme.NoTitleBar.Fullscreen" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

</application>
<uses-sdk android:minSdkVersion="9" />

</manifest>

就是设置主题为Theme.NoTitleBar.Fullscreen,

2 在代码中也可以设置:
requestWindowFeature(Window.FEATURE_NO_TITLE);
// hide statusbar of Android
// could also be done later
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);

更多相关文章

  1. Android不依赖Activity的全局悬浮窗实现
  2. Android不依赖Activity的全局悬浮窗实现
  3. Android中做一个无标题窗口
  4. Android(安卓)Theme的设置
  5. 介绍一个Android开源项目:GifView——Android显示GIF动画
  6. Android(安卓)gdb调试
  7. android TabHost小结
  8. android的edittext怎么设置不默认被选中,edit默认不弹出
  9. UI控件--EditText

随机推荐

  1. ORA-19566 exceeded limit of 0 corrupt
  2. Oracle 中 Object_iD 和 Data_Object_ID
  3. Linux下绑定网卡的操作记录
  4. mysql必知必会第一节
  5. mysql硬件优化
  6. Oracle dblink介绍
  7. python入门教程07-02 (python语法入门之函
  8. MySIAM与Innodb引擎
  9. Linux下通过受限bash创建指定权限的账号
  10. mysql中utf8和utf8mb4区别