dimanche 15 novembre 2015

Android checkbox image from

I have created file custom.xml, the checked.png is with size 150x150 pixel also unchecked.png have that size

<?xml version="1.0" encoding="utf-8"?>
<selector  xmlns:android="http://ift.tt/nIICcg">    
     <item android:state_checked="true" android:drawable="@drawable/checked" android:layout_height="10dp" />
     <item android:state_checked="false" android:drawable="@drawable/unchecked" />
</selector>

but when I create a checkbox in activitymain.xml like this

<CheckBox 
android:id="@+id/checkBox"
android:text="@string/check_box"            
android:button="@drawable/checked"
android:textColor="#DE2427"
android:textSize="15sp"
android:layout_weight="1"
android:checked="true"/>

it crops the image depending on textSize of checkbox so if I want to see all the png I have to make the textSize much bigger. How can fix this? I have tried with small png but it's not that clear




Aucun commentaire:

Enregistrer un commentaire