xml - How to resize image of checkbox in android? -


i adding image checkbox widget (that instead of default adding own image both clicked , unclciked in .xml file using selector)its geting added image not able resize small,it stays in original size.

how make image small ?

the code used create checkbox

    <checkbox             android:layout_width="match_parent"             android:layout_height="wrap_content"             android:background="@color/white"             android:button="@drawable/check_box"             android:drawablepadding="20dp"             android:text="check box text"             android:textcolor="@color/labelcolor" /> 

to set android:button field null , set checkbox states android:background field of checkbox.

your code become:

<checkbox android:id="@+id/cb" android:layout_width="wrap_content" android:layout_height="wrap_content"  android:button="@null" android:background="@drawable/check_box" android:drawablepadding="20dp" android:text="check box text" android:textcolor="@color/labelcolor" /> 

Comments

Popular posts from this blog

java - UnknownEntityTypeException: Unable to locate persister (Hibernate 5.0) -

python - ValueError: empty vocabulary; perhaps the documents only contain stop words -

ubuntu - collect2: fatal error: ld terminated with signal 9 [Killed] -