如何设置复选框边框颜色 [英] How to set checkbox border color

查看:151
本文介绍了如何设置复选框边框颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

复选框边框在白色背景上不可见.

The checkbox border is invisible on white background.

我使用了不同的颜色参数,但没有成功. 我需要盒子的黑色边框. 是的,这里有一些制作自定义复选框的例子. 在所有可绘制的示例中,普通框在新形状的内部可见. 可绘制形状很窄,在android:text=""中没有文本.

I played with different color parameters without success. I need black border of box. Yes, there examples to make custom checkbox. In all drawable examples the normal box is visible inside of new shape. And the drawable shape is narrow without text in android:text="".

但是为什么在普通的xml中复选框看起来不正确:

But why checkbox does not look okay in usual xml:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@+id/layoutBottom1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:background="#FFFFFF"
    android:gravity="center" >
    <CheckBox
        android:id="@+id/checkBottom1"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="AAAA"
        android:visibility="visible"
        android:textColor="#000000"
        android:checked="true" />

</LinearLayout>

有什么想法吗?谢谢!

推荐答案

您可以使用属性

android:buttonTint="what you want"设置复选框的边框颜色.

android:buttonTint="what you want" to set your checkbox border color.

这篇关于如何设置复选框边框颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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