摘要 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"

// 将一个Activity显示为对话框模式
 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:attr/textColorPrimaryInverse"

 android:textColor="?

android:attr/textColorSecondaryInverse"

Android的ProgressBar样式:

1
2
3
4
 style="?android:attr/progressBarStyleHorizontal"
 style="?

android:attr/progressBarStyleLarge"

 style="?

android:attr/progressBarStyleSmall"

 style="?android:attr/progressBarStyleSmallTitle"

分隔符



横向:

1
2
3
<View
android:layout_width=
"fill_parent"
android:layout_height="1dip"
android:background="?

android:attr/listDivider"

/>

纵向:

1
2
3
<View
android:layout_width=
"1dip"
android:layout_height="fill_parent"
android:background="?

android:attr/listDivider"

/>

CheckBox样式: 

style="?android:attr/starStyle"

类似标题栏效果的TextView



style="?android:attr/listSeparatorTextViewStyle"

其他实用的样式:

1
2
3
4
5
6
 android:layout_height="?android:attr/listPreferredItemHeight"
 android:paddingRight="?

android:attr/scrollbarSize"

 style="?

android:attr/windowTitleBackgroundStyle"

 style="?android:attr/windowTitleStyle"
 android:layout_height="?

android:attr/windowTitleSize"

 android:background="?

android:attr/windowBackground"

改动Activity的标题栏样式

如在styles.xml中添加:

1
2
3
4
5
6
7
8
9
<resources>
<style
name=
"AutoWindowTitleBackground">
<item
name=
"android:background">#778899</item>
</style>
<style
name=
"autoWindowTitlebar"

parent=
"android:Theme">
<item
name=
"android:windowTitleSize">32dp</item>
 <item
name=
"android:windowTitleBackgroundStyle">@style/AutoWindowTitleBackground</item>
 </style>
</resources>

接着再改动AndroidManifest.xml文件。找到要自己定义标题栏的Activity,加入上android:theme值。比方:

1
2
<activity
android:name=
".MainActivity"
 android:theme="@style/autoWindowTitlebar">

去掉全部Activity界面的标题栏

改动AndroidManifest.xml



在application 标签中加入:

1
android:theme=”@android:style/Theme.NoTitleBar”


Android开发之style属性和提前定义样式的更多相关文章

  1. Android开发之EditText属性详解

    1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: 把该EditText设为:android:password="true" // 以”.”形式显示文本 ( ...

  2. 【转】 Android开发之EditText属性详解

    原文网址:http://blog.csdn.net/qq435757399/article/details/7947862 1.EditText输入的文字为密码形式的设置 (1)通过.xml里设置: ...

  3. 【Android UI】Android开发之View的几种布局方式及实践

    引言 通过前面两篇: Android 开发之旅:又见Hello World! Android 开发之旅:深入分析布局文件&又是“Hello World!” 我们对Android应用程序运行原理 ...

  4. Android开发之PopupWindow

      /* *  Android开发之PopupWindow * *  Created on: 2011-8-8 *  Author: blueeagle *  Email: liujiaxiang@g ...

  5. Android开发之TextView高级应用

    Android开发之TextView高级应用 我们平时使用TextView往往让它作为一个显示文字的容器,但TextView的功能并不局限于此.以下就和大家分享一下TextView的一些使用技巧. A ...

  6. Android开发之InstanceState详解

    Android开发之InstanceState详解   本文介绍Android中关于Activity的两个神秘方法:onSaveInstanceState() 和 onRestoreInstanceS ...

  7. Android开发之旅: Intents和Intent Filters(理论部分)

    引言 大部分移动设备平台上的应用程序都运行在他们自己的沙盒中.他们彼此之间互相隔离,并且严格限制应用程序与硬件和原始组件之间的交互. 我们知道交流是多么的重要,作为一个孤岛没有交流的东西,一定毫无意义 ...

  8. Android 开发之旅:深入分析布局文件&又是“Hello World!”

    http://www.cnblogs.com/skynet/archive/2010/05/20/1740277.html 引言 上篇可以说是一个分水岭,它标志着我们从Android应用程序理论进入实 ...

  9. Android开发之InstanceState详解(转)---利用其保存Activity状态

    Android开发之InstanceState详解   本文介绍Android中关于Activity的两个神秘方法:onSaveInstanceState() 和 onRestoreInstanceS ...

随机推荐

  1. Hibernate 3中如何获得库表所有字段的名称

    15问:Hibernate 3中如何获得库表所有字段的名称 答:可以使用以下的程序获得. Configuration conf = new Configuration(); conf.configur ...

  2. 浅尝key-value数据库(一)——一览NoSQL

    浅尝key-value数据库(一)——一览NoSQL 最近由于一个项目的关系,研究了一下key-value数据库这个最近很火的概念.本系列从项目需求的角度分析并测试了几个key-value数据库的性能 ...

  3. scrapy新浪天气

    一.实验说明 1. 环境登录 无需密码自动登录,系统用户名shiyanlou 2. 环境介绍 本实验环境采用带桌面的Ubuntu Linux环境,实验中会用到桌面上的程序: LX终端(LXTermin ...

  4. 基于visual Studio2013解决算法导论之001插入排序

     题目 插入排序 解决代码及点评 #include <stdio.h> #include <time.h> #include <stdlib.h> void ...

  5. 算法练习之DP 求LCM (最长公共子序列)

    1. 对于序列x[1,i]和y[1,j],推导递推公式1.a 假设当前元素同样,那么就将当前最大同样数+12.b 假设当前元素不同.那么就把当前最大同样数"传递"下去 因此递推公式 ...

  6. 基于集合成工控机Ubuntu系统安装分区详解

    基于集合成工控机Ubuntu系统安装分区详解 硬件描述:双核的CPU,128G的固态硬盘 软件描述:使用Ubuntu12.04系统,内核3.8.0-29版本,QT4.8.1版本 1.新建分区表 /de ...

  7. 一个大学生屌丝心中的seo梦

    最 近这几天,我利用空闲时间去网上看到很多关于seoer的生存现状,尤为的感伤.因为自已也是一位爱好seo和利用闲于时间来学习seo的一个大学生屌 丝,在学习的过程中,有辛酸和泪水.但也有快乐,感觉一 ...

  8. TCP与UDP在socket编程中的区别 (网络收集转载)

    http://blog.chinaunix.net/uid-26421509-id-3814684.html 一.TCP与UDP的区别 基于连接与无连接  对系统资源的要求(TCP较多,UDP少)  ...

  9. delphi json(CDS包含了Delta数据包)

    在delphi中,数据集是最常用数据存取方式.因此,必须建立JSON与TDataSet之间的互转关系,实现数据之间通讯与转换.值得注意的是,这只是普通的TDataset与JSON之间转换,由于CDS包 ...

  10. 树——axure线框图部件库介绍

    终于到最后一个组件的介绍了!到这里基础的应用应该算完成了!  1. 拖动树组件,到页面编辑区域  2.添加节点,可以添加子节点也可以在该节点的前后添加平级节点  3. 编辑节点图标 做好上面的那一步, ...