是一个颜色选择器(selector),用于在Android应用程序中定义不同状态下的颜色变化。它包含三个<item>元素,分别对应以下状态:

当视图(如按钮)被按下时,应用半透明的深灰色。
当视图被选中时,应用半透明的浅灰色。
在没有特定状态(如默认状态)下,应用不透明的黑色。
这个选择器通常与按钮或其他可交互视图一起使用,以提供视觉反馈,指示用户交互的不同状态。
zhangli1
LZ 3 months ago
parent 80da33f388
commit 0da440a0ac

@ -0,0 +1,47 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- XML声明指定文档版本为1.0编码格式为UTF-8 -->
<!--
Copyright (c) 2010-2011, The MiCode Open Source Community (www.micode.net)
版权信息版权归2010-2011年MiCode开源社区所有网址www.micode.net
Licensed under the Apache License, Version 2.0 (the "License");
许可信息此文件受Apache License 2.0版(“许可证”)许可
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.
请参阅许可证以了解有关权限和许可证下限制的特定条款
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<!-- 定义颜色选择器,用于在不同状态下改变颜色 -->
<!-- 当按钮或视图被按下时,应用半透明的深灰色(#88555555 -->
<item android:state_pressed="true" android:color="#88555555" />
<!-- 当按钮或视图被选中时,应用半透明的浅灰色(#ff999999 -->
<item android:state_selected="true" android:color="#ff999999" />
<!-- 默认情况下,应用不透明的黑色(#ff000000 -->
<item android:color="#ff000000" />
</selector>
Loading…
Cancel
Save