android 字体颜色选择器(ColorPicker)介绍
程序员文章站
2023-12-15 11:44:28
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>
复制代码 代码如下:
<?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>
推荐阅读
-
android 字体颜色选择器(ColorPicker)介绍
-
Android 实现不同字体颜色的TextView实现代码
-
Android Studio怎么自定义颜色?Android Studio更换字体大小颜色的方法
-
DW在哪里修改字体颜色?DW修改字体颜色方法介绍
-
Android编程实现TextView字体颜色设置的方法小结
-
android studio怎么设置android Logcat字体颜色?
-
Android开发笔记 改变字体颜色的三种方法
-
android 字体颜色选择器(ColorPicker)介绍
-
Android 实现不同字体颜色的TextView实现代码
-
listview改变选中行的字体颜色实例介绍