在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. 1、android源代码下载与跟踪
  2. android经典开源代码集合
  3. ReactNative调用原生封装的代码和控件
  4. Android开发人员不得不收集的代码(持续更新中)
  5. Android清除本地数据缓存代码
  6. Android 代码执行Linux Shell小记
  7. android studio中xml文件代码提示问题

随机推荐

  1. android json httppost方式联网
  2. android弹出下拉选择菜单,单选,多选
  3. android 中让activity全屏幕显示
  4. 安卓第三次作业
  5. xbmc 从android_main启动时的部分步骤记
  6. RelativeLayout
  7. Android富文本图文混排、粗体、斜体、图
  8. Github Actions Android(安卓)CI打包配置
  9. android 学习记录
  10. Python基础——列表、元组、字典