Android窗口主题与风格(Style and Theme)
来源:互联网 发布:javascript 回车字符 编辑:程序博客网 时间:2024/04/29 19:07
概述
android应用,大家第一反应可能是:点开应用图标,进入全屏窗口显示详细信息。殊不知,android应用显示的窗口不单单是全屏,还可以有其他的样式。比如,背景透明的,对话框的。
最简单的使用办法,直接在manifest里application或者activity里添加:
<activity android:name=".view.MainActivity" android:theme="@android:style/Theme.Dialog">
效果:
第二种:自定义主题
在上一个基础上做出一些修改,比如:改窗口高度和颜色,
首先在values文件下新建一个.xml文件
<?xml version="1.0" encoding="utf-8"?><resources> <style name="DialogTheme" parent="@android:style/Theme.Dialog"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style></resources>然后在manifest文件里添加:
<activity android:name=".view.MainActivity" android:theme="@style/DialogTheme">
0 0
- Android窗口主题与风格(Style and Theme)
- Android风格与主题( style and theme )
- Android风格与主题(style and theme)
- Android风格与主题(style and theme)
- Android风格与主题(style and theme)
- Android风格与主题(style and theme)
- Android 风格与主题(style and theme)
- Android风格与主题(style and theme)
- Android 风格与主题(style and theme)
- Android 风格与主题(style and theme)
- android风格和主题:Style and Theme
- Android风格style与主题theme
- android之风格与主题(style与theme)
- android 主题theme风格style
- Android 应用界面风格与主题(style and theme)
- android主题theme和风格style总结
- Android主题theme和风格style总结
- Android主题theme和风格style总结
- c++引用标准c库close出错 error: too many arguments to function call, expected 0, have 1
- web.py模板之控制结构
- Ubuntu的一些小tip
- linux学习笔记--slabtop命令
- Axis2开发webservice详解
- Android窗口主题与风格(Style and Theme)
- 使用Canvas来压缩图片
- 代理和反向代理
- JUnit4使用教程-快速入门
- 463. Island Perimeter
- httpclient 4.3.2 post get的工具类
- JSP 内置对象简述
- Mybatis中#和$的区别
- 【webservice】如何远程调用Websevice服务