摘要 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. Haxe UI框架StablexUI的使用备忘与心得(一)

    这一节先来说说StablexUI的基本方面. 安装与使用,在官方文档里Getting Started一章里写的很清楚,这里就不展开了,简单总结来说: * StablexUI依赖于actuate缓动库和 ...

  2. CF 338E Optimize! (线段树)

    转载请注明出处,谢谢http://blog.csdn.net/ACM_cxlove?viewmode=contents    by---cxlove 出题人题解没看懂...囧. 然后看了下touris ...

  3. 八:Java之I/O

    一.什么是IO Java中I/O操作主要是指使用Java进行输入,输出操作. Java全部的I/O机制都是基于数据流进行输入输出.这些数据流表示了字符或者字节数据的流动序列.Java的I/O流提供了读 ...

  4. poj3819 Coverage (求直线与圆的交占直线的百分比 )

    题意:给你一条直线和若干个圆,求圆与直线相交的长度占整条直线的比例 解题思路:通过定比分点的方法求出圆与直线的交占圆的比例. 第一步:(确定投影的方向是x轴还是y轴) (1)当直线的line.s(x, ...

  5. stm32智能小车之路之小车启动

           首先.安装完小车后最激动的还是想让他跑动,那么就開始吧.写个简单的程序測试下电机是否正常.打开keil软件新建一个project,详细简历keilproject不会的请百度.或者call ...

  6. em换算px

    一般浏览器默认的1em=16px,所以常用字体大小如下: 10px=0.625em 12px=0.75em 14px=0.875em 16px=1em 18px=1.125em 20px=1.25em ...

  7. BBED的安装及简单的使用方法

    记录下BBED的安装--ORACLE 11.2.0.4下 1.在ORACLE 11G下安装BBED,需要从ORACLE 10G中复制三个包 bbedus.msb               sbbdp ...

  8. 如何查看VS中预设的路径变量

    类似"$(VCInstallDir)"之类的变量查询方法为:打开VS命令行提示窗口,输入 Set 命令. VS中“Tool” - “Visual Studio Command Pr ...

  9. jQuery.localStorage() - jQuery SDK API

    jQuery.localStorage() - jQuery SDK API jQuery.localStorage() From jQuery SDK API   Jump to: navigati ...

  10. javascript模板引擎之artTemplate 学习笔记

    <div id="content"></div><div id="content1"></div><h1& ...