复选框内的Android缩放图像 [英] Scale image inside a checkbox android
问题描述
我改变试图fitXY我的复选框我的自定义图像。我跟着下面的计算器,以了解如何加载自定义图像,问题是,完整的图像不会出现在该复选框。我期待的android:scaleType =fitXY
的复选框的形象,但我不能得到它的工作。 (我不能添加在XML的属性复选框)
I am changing trying to "fitXY" for my custom image of my CheckBox. I followed the below stackoverflow to understand how to load custom images, the problem is that the full image doesn't appear in the check box. I am looking to android:scaleType="fitXY"
for the the checkbox image, but I cannot get it to work. (I cannot add that attribute to the checkbox in the xml)
<一个href=\"http://stackoverflow.com/questions/11302428/changing-default-color-of-android-checkbox-check-mark\">Changing Android的CheckBox的默认颜色复选标记
推荐答案
使用切换按钮来代替。之后,你可以设置绘制到它的背景。切换按钮和复选框的方法几乎是相同的。
Use ToggleButton instead. After that you can set drawable to its background. The methods of ToggleButton and Checkbox are almost the same.
这篇关于复选框内的Android缩放图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!