Android开发之style属性和提前定义样式
摘要 Android平台定义的主题样式: android:theme="@android:style/Theme.Dialog" // 将一个Activity显示为对话框模式android:theme="@android:style/Theme.NoTitleBar" // 不显示应用程序标题栏android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
//
Android平台定义的主题样式:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
android:theme="@android:style/Theme.Dialog" android:theme="@android:style/Theme.NoTitleBar" android:theme="@android:style/Theme.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.Light" android:theme="@android:style/Theme.Light.NoTitleBar" android:theme="@android:style/Theme.Light.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.Black" android:theme="@android:style/Theme.Black.NoTitleBar" android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen" android:theme="@android:style/Theme.Wallpaper" android:theme="@android:style/Theme.Wallpaper.NoTitleBar" android:theme="@android:style/Theme.Wallpaper.NoTitleBar.Fullscreen" android:theme="@android:style/Translucent" android:theme="@android:style/Theme.Translucent.NoTitleBar" android:theme="@android:style/Theme.Translucent.NoTitleBar.Fullscreen" |
Android平台定义了三种字体大小:
|
1
2
3
|
"?android:attr/textAppearanceLarge" "?android:attr/textAppearanceMedium" "?android:attr/textAppearanceSmall" |
Android字体颜色:
|
1
2
3
4
5
|
android:textColor="?android:attr/textColorPrimary" android:textColor="?android:attr/textColorSecondary" android:textColor="?android:attr/textColorTertiary" android:textColor="?
android:textColor="?
|
Android的ProgressBar样式:
|
1
2
3
4
|
style="?android:attr/progressBarStyleHorizontal" style="?
style="?
style="?android:attr/progressBarStyleSmallTitle" |
分隔符
横向:
|
1
2
3
|
<View"fill_parent"android:layout_height="1dip"android:background="?
|
纵向:
|
1
2
3
|
<View"1dip"android:layout_height="fill_parent"android:background="?
|
CheckBox样式:
style="?android:attr/starStyle"
类似标题栏效果的TextView
style="?android:attr/listSeparatorTextViewStyle"
其他实用的样式:
|
1
2
3
4
5
6
|
android:layout_height="?android:attr/listPreferredItemHeight" android:paddingRight="?
style="?
style="?android:attr/windowTitleStyle" android:layout_height="?
android:background="?
|
改动Activity的标题栏样式
如在styles.xml中添加:
|
1
2
3
4
5
6
7
8
9
|
<resources><style"AutoWindowTitleBackground"><item"android:background">#778899</item></style><style"autoWindowTitlebar""android:Theme"><item"android:windowTitleSize">32dp</item> <item"android:windowTitleBackgroundStyle">@style/AutoWindowTitleBackground</item> </style></resources> |
接着再改动AndroidManifest.xml文件。找到要自己定义标题栏的Activity,加入上android:theme值。比方:
|
1
2
|
<activity".MainActivity" android:theme="@style/autoWindowTitlebar"> |
去掉全部Activity界面的标题栏
改动AndroidManifest.xml
在application 标签中加入:
|
1
|
android:theme=”@android:style/Theme.NoTitleBar” |
Android开发之style属性和提前定义样式的更多相关文章
- Android开发之EditText属性详解
1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 ( ...
- 【转】 Android开发之EditText属性详解
原文网址:http://blog.csdn.net/qq435757399/article/details/7947862 1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: ...
- 【Android UI】Android开发之View的几种布局方式及实践
引言 通过前面两篇: Android 开发之旅:又见Hello World! Android 开发之旅:深入分析布局文件&又是“Hello World!” 我们对Android应用程序运行原理 ...
- Android开发之PopupWindow
/* * Android开发之PopupWindow * * Created on: 2011-8-8 * Author: blueeagle * Email: liujiaxiang@g ...
- Android开发之TextView高级应用
Android开发之TextView高级应用 我们平时使用TextView往往让它作为一个显示文字的容器,但TextView的功能并不局限于此.以下就和大家分享一下TextView的一些使用技巧. A ...
- Android开发之InstanceState详解
Android开发之InstanceState详解 本文介绍Android中关于Activity的两个神秘方法:onSaveInstanceState() 和 onRestoreInstanceS ...
- Android开发之旅: Intents和Intent Filters(理论部分)
引言 大部分移动设备平台上的应用程序都运行在他们自己的沙盒中.他们彼此之间互相隔离,并且严格限制应用程序与硬件和原始组件之间的交互. 我们知道交流是多么的重要,作为一个孤岛没有交流的东西,一定毫无意义 ...
- Android 开发之旅:深入分析布局文件&又是“Hello World!”
http://www.cnblogs.com/skynet/archive/2010/05/20/1740277.html 引言 上篇可以说是一个分水岭,它标志着我们从Android应用程序理论进入实 ...
- Android开发之InstanceState详解(转)---利用其保存Activity状态
Android开发之InstanceState详解 本文介绍Android中关于Activity的两个神秘方法:onSaveInstanceState() 和 onRestoreInstanceS ...
随机推荐
- Visual Studio 2012的新技术特性
前言 我更换了VS2012开发工具,那么它有什么特性呢? [caption id="attachment_1235" align="alignnone" wid ...
- Creating Spatial Indexes(mysql 创建空间索引 The used table type doesn't support SPATIAL indexes)
For MyISAM tables, MySQL can create spatial indexes using syntax similar to that for creating regula ...
- Jump的计划
欢迎訪问我的github:https://github.com/xdnm 1.熟悉cocos2dx2.2.3开发框架 a.熟悉cocos2d api ...
- PHP - 类库
常用的PHP类库,PHP开发者必备[转] PHP开发者常用的PHP类库和组件 PDF 生成器 FPDF - 这量一个可以让你生成PDF的纯PHP类库. Excel 相关 你的站点需要生成Excel?没 ...
- 总线接口与计算机通信(一)I2C总线
1. I2C总线的基本概念 1)发送器(Transmitter):发送数据到总线的器件 2)接收器(Receiver):从总线接收数据的器件 3)主机(Master):初始化发送. ...
- Qt读取ANSI格式文件——利用QTextCodec将其他编码格式的QByteArray转换为Unicode格式,或者从文件中读出后直接做转换
t使用Unicode来表示字符串.但是通常需要访问一些非Unicode格式的字符串,例如打开一个GBK编码的中文文本文件,甚至一些非Unicode编码的日文,俄文等. Qt提供了QTextCodec类 ...
- 配置Eclipse使用外部Maven
当集成Maven时,Eclipse会安装上一个内嵌的Maven, 这个内嵌的Maven通常会比较新,但不一定很稳定,而且往往也会和命令行使用的Maven不是同一个版本.这里又会出现两个潜在的问题:首先 ...
- SIX GOD
SIX GOD是什么意思呢.?_百度知道 SIX GOD
- C#超级有用的一种类型—匿名类型
顾名思义 匿名类型就是没有名字的类型.当一个新的匿名对象定义与前面已经存在的类型定义的内部变量类型同样时,编译器就会仅仅生成一个类定义,而不是各一个. 匿名类型对象中仍然能够再包括匿名对象. 在C#3 ...
- javaEE开发之导出excel工具类
web开发中,一个系统的普通需求也包含导出excel,一般採用POI做统计报表导出excel. 导出excel工具类: import java.io.FileOutputStream; import ...