如何自定义勾选颜色机器人在对话框的颜色。 :机器人 [英] How to customize the color of the CheckMark color in android in a dialog. : android

查看:159
本文介绍了如何自定义勾选颜色机器人在对话框的颜色。 :机器人的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何自定义勾选颜色机器人在对话框的颜色。目前,在默认情况下,复选标记的颜色是绿色的默认。我想将其定义为不同的颜色的选择

How to customize the color of the CheckMark color in android in a dialog. Currently , By default, the color of the checkmark is green by default. I would like to customize it to a different color of choice

推荐答案

如果你看一下<一href="http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/res/res/values/styles.xml;h=d7b654e49809cb97a35682754b1394af5c8bc88b;hb=HEAD">styles.xml从android系统,您将看到复选框类型的定义如下:

If you look at the styles.xml from android system, you will see that the checkbox style is defined as follows :

<style name="Widget.CompoundButton.CheckBox">
   <item name="android:background">@android:drawable/btn_check_label_background</item>
   <item name="android:button">@android:drawable/btn_check</item>
</style>

如果你搜索系统中的资源,你会看到btn_check是绘制选择器2状态(开/关)用彩色绿色或不检查。
所以,如果你想拥有自己的颜色绘制,这里是你应该做的:
- 创建一个styles.xml
- 定义2可绘制使用
- 创建XML文件配套的选择

And If you search the resources of the system, you will see that btn_check is a drawable selector with 2 states (on/off) with the check colored green or not.
So if you want to have your own color-drawable, here is what you should do :
- create a styles.xml
- define the 2 drawables to use
- create the xml file supporting the selector

您可以找到完整的文档非常相关详细的的谷歌Android文档。

You can find the full documentation quite detailled on the android google doc.

这篇关于如何自定义勾选颜色机器人在对话框的颜色。 :机器人的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆