androud的窗口模式,就是activity不占用整个的手机屏幕,以窗口的样式呈现出来。

你如果在manifest中该的话:

<application        android:allowBackup="true"        android:icon="@drawable/ic_launcher"        android:label="@string/app_name"        android:theme="@android:style/Theme.Dialog" >

这是直接的使用原生的窗口主题,默认的背景是黑色的。

这样看起来不是很美观的。那我们在Layout中,直接设置布局的背景为白色的话:

    android:background="@android:color/white"

我们就可以看到,下面白色的部分就是布局的区域了,上面的黑色是项目的名称。

这样对下,我们就好区别屏幕区域到底是哪里了。


但我们想自己定义主题,那该咋办呢?

我们在style中,添加一个自定义主题,它的父主题是窗口模式:

    <!-- Application theme. -->    <style name="AppTheme" parent="android:Theme.Dialog">        <!-- All customizations that are NOT specific to a particular API-level can go here. -->    <item name="android:background">@android:color/darker_gray</item>    </style>

在这里我们只是改了下背景颜色,其他的根据需要,像一般的主题那样改就可以了。



更多相关文章

  1. Android中使Dialog显示时背景不变暗
  2. Hello Android(安卓)- android窗体透明的,黑暗度等的设置技巧
  3. android背景选择器selector用法汇总
  4. ListItem更改背景色
  5. 调出软键盘 挤掉标题栏咋办
  6. 样式 主题 对话框 国际化
  7. 【android开发】styles.xml常用的设置属性汇总
  8. Android(安卓)tabhost让选中项加上背景图
  9. Android背景图片平铺

随机推荐

  1. Android(安卓)Studio Exception: Could n
  2. Android电池管理
  3. android 蓝牙driver的启动流程
  4. Android中的compileSdkVersion,minSdkVers
  5. LinearLayout布局中layout_weight的用法
  6. android输出log信息
  7. Android(安卓)编译App报错 找不到android
  8. android 语言简写对应表
  9. Android(安卓)Animation --- 无限360度旋
  10. android字体闪烁动画(线程)