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 ...
随机推荐
- Android项目实战手机安全卫士(01)
目录 项目结构图 源代码 运行结果 项目结构图 源代码 SplashActivity.java package com.coderdream.mobilesafe.activity; import a ...
- jsp各部分编码的含义
服务器JSP编码 pageEncoding 是jsp文件本身的编码, 第一阶段是jsp编译成.java,它会根据pageEncoding的设定读取jsp,(jsp文件的编码,pageEncoding是 ...
- Android---60---Notification 通知栏的简单使用
Notification是显示在手机状态栏的通知 通过Notification.Builder类创建Notification对象. Notification.Builder经常用法: setDefau ...
- bash on windows
bash on windows 今年微软Build 2016大会最让开发人员兴奋的消息之一,就是在Windows上可以原生运行Linux bash,对开发人员来说,这是一个喜闻乐见的消息. 1 安装 ...
- 利用Ihttpmodel实现网站缓存,解决Server.Transfer 直接输出HTML源代码的问题
今天在用.NET利用IHttpModel实现网站静态缓存的时候,不知道最后为什么用 Server.Transfer(html)的时候结果输出的是HTML的源代码. 贴上源代码 using System ...
- VDI转vmdk(VirtualBox与VMware硬盘格式转换)[转]
VirtualBox用了一段时间,感觉没想像中那么的好.虽然设置里可以分配多CPU,但是分配多CPU后经常系统挂掉.整体感觉不够稳定,但它也有好处就是开源免费.但经常挂机总不能一直使用它,索性转到Vm ...
- System.gc
Java中的内存分配是随着new一个新的对象来实现的,这个很简单,而且也还是有一些可以“改进”内存回收的机制的,其中最显眼的就是这个System.gc()函数. 乍一看这个函数似乎是可以进行垃圾回收的 ...
- 基于visual Studio2013解决C语言竞赛题之1015日期计算
题目 解决代码及点评 /* 15. 已知某年不是闰年,给定该年某一天的月份和日期, 求这一天是该年的第几天. */ #include <stdio.h> #incl ...
- Get started - UIkit documentation
Get started - UIkit documentation Get started Get familiar with the basic setup and structure of UIk ...
- 【Android】自己定义控件——仿天猫Indicator
今天来说说类似天猫的Banner中的小圆点是怎么做的(图中绿圈部分) 在学习自己定义控件之前,我用的是很二的方法,直接在布局中放入多个ImageView,然后代码中依据Pager切换来改变图片.这样的 ...