欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

android 字体颜色选择器(ColorPicker)介绍

程序员文章站 2023-12-05 17:24:46
primary_text_yellow.xml 复制代码 代码如下:
primary_text_yellow.xml
复制代码 代码如下:

<?xml version="1.0" encoding="utf-8"?>
<!-- copyright (c) 2008 the android open source project
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.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_enabled="false" android:color="@color/yellow"/>
<item android:state_window_focused="false" android:color="@android:color/black"/>
<item android:state_pressed="true" android:color="@color/yellow"/>
<item android:state_selected="true" android:color="@color/yellow"/>
<item android:color="@android:color/black"/>
<!-- not selected -->
</selector>

themes.xml
复制代码 代码如下:

<item name="android:textcolor">@color/primary_text_yellow</item>