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 ...
随机推荐
- c语言,动态数组
试着直接malloc一个2*3*4的空间来模拟数组: #include <stdio.h> #include <malloc.h> int main(void) { int** ...
- 用反射,将DataRow行转为Object对象
/// <summary> /// 反射辅助类 /// </summary> public class ReflectionHelper { /// <summary&g ...
- iphone开发教程下载
iphone开发教程下载 3月份花了1个月研究ios 开发,看了几百页的iphone开发教程,累积了不少电子书,盘点一下 Beginning iPhone 4 Development: Explori ...
- 基于visual Studio2013解决C语言竞赛题之1016循环打印矩阵
题目 解决代码及点评 /* 找规律,编程序打印6×6的矩阵: 1 2 3 5 8 13 1 4 9 17 30 51 1 6 19 45 92 173 . . . */ ...
- C语言声明解析方法
1.C语言声明的单独语法成份 声明器是C语言声明的非常重要成份,他是所有声明的核心内容,简单的说:声明器就是标识符以及与它组合在一起的任何指针.函数括号.数组下表等,为了方便起见这里进行分类表 ...
- http权威指南 telnet
对于winXP 1.先启动一个telnet程序连接到TCP服务器中. telnet www.joes-hardware.com 80 2.在连接上的TCP服务器的telnet程序窗口中同时按下 &qu ...
- kali之ARP欺骗获取图片流
其实很简单,就两步: 1. 后接三个参数: 网卡:eth0 网关:10.0.0.1 攻击目标:10.0.0.128 2.启动监听 会弹出一个框 里面就会显示攻击目标通过浏览器访问的页面上的 ...
- PHP学习之-1.6 PHP语句结束符
PHP语句结束符 是不是我们在javascript,Java 的每一句代码结束的地方都有一个分号 ";" PHP的结束符号也是 ";". 注意:在PHP编程中需 ...
- 高性能JavaScript模板引擎原理解析
随着 web 发展,前端应用变得越来越复杂,基于后端的 javascript(Node.js) 也开始崭露头角,此时 javascript 被寄予了更大的期望,与此同时 javascript MVC ...
- Makefile自动生成工具-----autotools的使用(详细)
相信每个学习Linux的人都知道Makefile,这是一个很有用的东西,但是编写它是比较复杂,今天介绍一个它的自动生成工具,autotools的使用.很多GNULinux的的软件都是用它生成Makef ...