|
|
|
@ -1,2 +1,8 @@
|
|
|
|
|
# 123456
|
|
|
|
|
|
|
|
|
|
<?xml version="1.0" encoding="UTF-8"?>//这是 XML 声明,表明这份 XML 文档遵循 XML 1.0 标准,使用的字符编码是 UTF-8。UTF-8 是一种常用编码,能表示世界上绝大多数的字符,保证文档内容在不同系统间的兼容性。
|
|
|
|
|
<!-- Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net) Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.--> - //这是一段注释内容,用于说明版权信息。告知代码的版权归属是 MiCode 开源社区,时间跨度为 2010 - 2011 年,并且声明该代码基于 Apache 2.0 许可证授权,详细解释了使用该代码的一些许可条款和条件
|
|
|
|
|
<selector xmlns:android="http://schemas.android.com/apk/res/android"> <selector> 是 Android 系统里用于定义状态选择器的标签。// xmlns:android 是一个 XML 命名空间声明, http://schemas.android.com/apk/res/android 指明了 Android 系统提供的资源相关的 XML 命名空间,后续使用到的 android 前缀的属性,都来自这个命名空间。借助这个命名空间,才能使用 Android 特有的属性来定制这个选择器
|
|
|
|
|
|
|
|
|
|
<item android:color="#50000000" />-- <item> //是 <selector> 的子元素。这里设置了一个属性 android:color ,其值为 #50000000 ,这是一个颜色值,在 Android 里使用十六进制来表示颜色,前两位数字(这里是 50 )表示透明度,后面六位数字( 000000 )表示颜色, 000000 代表黑色,整体表示一个半透明的黑色。这个 <item> 元素单独存在时,大概率用于某些默认状态下的颜色设定,比如在状态选择器里,如果没有其他匹配的状态,就会应用这个颜色。
|
|
|
|
|
</selector>-。-// 闭合 selector 标签,与开头的 <selector> 对应,完成了这个选择器的 XML 定义。
|