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 ...
随机推荐
- oracle 表复制
1. 复制表结构及其数据: create table table_name_new as select * from table_name_old 2. 只复制表结构: ; 或者 create tab ...
- 在Myeclipse中安装java Decompiler
由于在myeclipse中的Help选项中没有Install New Software,所以在eclipse中安装插件的方法并不适应于Myeclipse,但是我们可以通过点击Windows->P ...
- Android应用之基本的组件(一)
请大家伙多多指教: 邮箱:weimingweicom@sina.com 请关注:ailiandeziwei 总的页面: 注意:按钮间方法的改变需要: android:onClick=" ...
- opencv视频播放
在一个界面上显示一张图片.是一件非常easy的事情,但说到要显示视频.刚開始学习的人可能不知道怎么处理,事实上,一般来说能够理解为视频就是图片以人眼察觉不到的速度高速更新. 曾经用摄像头採集视频显示在 ...
- Tomcat 7最大并发连接数的正确修改方法(转)
几乎所有的中文网页都介绍,要修改Tomcat的默认最大并发连接数,应该进行如下设置(实际上这些步骤是错误的): -------------------------------------------- ...
- 基于visual Studio2013解决面试题之1003字符串逆序
题目
- MFC获取rgb图像数据后动态显示及保存图片的方法
该情况可用于视频通信中获取的位图数据回放显示或显示摄像头捕获的本地图像 第一种方法 #include<vfw.h> 加载 vfw32.lib 链接库 //---------------- ...
- Serialize a Binary Tree or a General Tree
For a binary tree, preorder traversal may be enough. For example, _ / \ / / \ 50 ...
- listview——显示窗体
listview——是用来显示的控件 一,属性 view:(显示的视图)LargeIcon——大图标:SmallIcon——小图标:Details——详细:List——列表:TItle——平铺 Sma ...
- Python 学习入门(21)—— 线程
本文介绍了Python对于线程的支持,包括“学会”多线程编程需要掌握的基础以及Python两个线程标准库的完整介绍及使用示例. 1. 线程基础 1.1. 线程状态 线程有5种状态,状态转换的过程如下图 ...