Styles and Themens(5)样式文件Style.xml中各元素的含义
Style Resource
See also
A style resource defines the format and look for a UI. A style can be applied to an individual View (from within a layout file) or to an entire Activity or application (from within the manifest file).
For more information about creating and applying styles, please readStyles and Themes.
Note: A style is a simple resource that is referenced using the value provided in the name attribute (not the name of the XML file). As such, you can combine style resources with other simple resources in the one XML file, under one <resources> element.
- FILE LOCATION:
-
res/values/filename.xml
The filename is arbitrary. The element's
namewill be used as the resource ID. - RESOURCE REFERENCE:
-
In XML: @[package:]style/style_name
- SYNTAX:
-
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style
name="style_name"
parent="@[package:]style/style_to_inherit">
<item
name="[package:]style_property_name"
>style_value</item>
</style>
</resources> - ELEMENTS:
-
1,<resources>- Required. This must be the root node.
- No attributes.
2,<style>Defines a single style. Contains<item>elements.
attributes:
-
name String. Required. A name for the style, which is used as the resource ID to apply the style to a View, Activity, or application. parent Style resource. Reference to a style from which this style should inherit style properties. 3,<item>Defines a single property for the style. Must be a child of a<style>element.
attributes:
-
name Attribute resource. Required. The name of the style property to be defined, with a package prefix if necessary (for example android:textColor).
- EXAMPLE:
-
- XML file for the style (saved in
res/values/): -
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="CustomText" parent="@style/Text">
<item name="android:textSize">20sp</item>
<item name="android:textColor">#008</item>
</style>
</resources> - XML file that applies the style to a
TextView(saved inres/layout/): -
<?xml version="1.0" encoding="utf-8"?>
<EditText
style="@style/CustomText"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:text="Hello, World!" />
- XML file for the style (saved in
Styles and Themens(5)样式文件Style.xml中各元素的含义的更多相关文章
- ckplayer 中的style.swf 中的 style.xml 中的修改方法
style.swf ---- > style.zip ---- > 解压成文件夹 ---- > 打开style.xml ---- > 修改 最重要的是修改保存style.xml ...
- 我的Android进阶之旅------>Android资源文件string.xml中\u2026的意思
今天看了一个string.xml文件,对其中的一行代码中包含的\u2026不是很理解,后来查阅资料后发现了其中的意思. 代码如下: <resources xmlns:xliff="ur ...
- dom4j修改,获取,增加xml中某个元素的属性值
XML文件: <?xml version="1.0" encoding="UTF-8"?> <vrvscript> <item I ...
- web.xml中常用元素的解读
前言 针对一个项目而言,通常会有几类XML文件需要书写. web.xml spring-context.xml spring-mvc.xml other.xml ... 不管有多少配置文件,可以肯定的 ...
- Maven pom.xml中的元素modules、parent、properties以及import
前言 项目中用到了maven,而且用到的内容不像利用maven/eclipse搭建ssm(spring+spring mvc+mybatis)用的那么简单:maven的核心是pom.xml,那么我就它 ...
- Maven pom.xml中的元素modules、parent、properties以及import(转)
前言 项目中用到了maven,而且用到的内容不像利用maven/eclipse搭建ssm(spring+spring mvc+mybatis)用的那么简单:maven的核心是pom.xml,那么我就它 ...
- SkinSoft中.vssf样式文件在VS2005中的应用(图文)
前些天在项目中应用了皮肤控件,涉及到了(.ssk),也做了相应的记录. 但还是觉得.ssk的并不算满意,所以今天又粗略的研究了一下SkinSoft这个软件: 如题,他的作用就是自定义控件与窗体样式. ...
- 如何把maven文件pom.xml中的java包下载下来
右击pom.xml文件,选择Run As-->Maven build- 在打开的页面中,如图输入"dependency:copy-dependencies",后点击" ...
- dom4j解析xml中指定元素下内容
需求:XML为例如以下样式,如今我仅仅想取得timer以下的5000和60000. 解决的方法例如以下: <?xml version="1.0" encoding=" ...
随机推荐
- ###《High-level event recognition in unconstrained videos》
Author: Yu-Gang Jiang, Shih-Fu Chang 事件检测的目标就是自动识别给定视频序列中的感兴趣事件.进行视频事件检测通常很困难,特别是在网络中非限制的视频.在非限制情况下, ...
- 第五篇、常用的SQL语句和函数介绍
简介: 在使用到sqlite3的时候,常常需要写一些SQL语句,现将常用到的部分语句稍微总结以下,由于个人习惯,关键字用大写. 附: /*简单约束*/ CREATE TABLE IF NOT EXIS ...
- ios简单数据库运用
一.添加类 二.打开数据库 三.创表 四.插入数据 五.取出数据 一.添加类 1.在设置Linked Frameworks and Libraries 中,点加号并添加libsqlite3.0.dyl ...
- textLayout在快速输入清除时报错解决方法
var tf:TextFlow; var len:int = tf.numChildren;for (var i:int = 0; i < len; i += 1){ tf.removeChil ...
- MySQL的记录长度
MySQL的记录长度 MySQL默认规定一条记录最大的长度是65535字节,所有的字段加在一起所占的字节数不能超过65535.但是MySQL中字段的长度有的时使用字节来规定int,有些字段类型是使用字 ...
- 2016/7/7 自定义函数copy
题目:输入整数n(n<=10000),表示接下来将会输入n个实数,将这n个实数存入数组a中.请定义一个数组拷贝函数将数组a中的n个数拷贝到数组b中. 分析: (1)输入n,再输入n个实数存入数组 ...
- Hyper-V 测试
云平台的虚拟服务器,基本上没有免费的(试用时间基本上都是1个月),按月收费最低的套餐(1个CPU核心.512内存)一般都是将近100元 所以索性还是自己搭建一个技术测试环境吧 上学的时候一直用的是VM ...
- OpenJudge/Poj 1226 Substrings
1.链接地址: http://bailian.openjudge.cn/practice/1226/ http://poj.org/problem?id=1226 2.题目: 总时间限制: 1000m ...
- <<深入Java虚拟机>>-第三章-垃圾收集器与内存分配策略-学习笔记
垃圾收集 垃圾收集(Garbage Collection,GC),垃圾收集需要完成的三件事情. 哪些对象需要回收 什么时候回收 如何回收 如何确定对象已死(即不可能在被任何途径引用的对象) 引用计数算 ...
- 关于NPC和NP-Hard问题
参考链接: 1. P.NP.NPC和NP-hard问题的理解 参考:<算法导论>