androidcheckedtextview

How to insert the drawable above the text in CheckedTextView?


This is my XML code:

    <CheckedTextView 
android:id="@+id/checkBLC"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/baloncesto"
android:checked="false" 
android:checkMark="@drawable/checkbox_blc"/>

I have read this post

And i Try this, but not working:

android:checkMarkDrawable="drawableTop"

Thank.


Solution

  • Try  android:drawableTop="@drawable/your_image"  
    
      <CheckedTextView 
            android:id="@+id/checkBLC"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/baloncesto"
            android:checked="false" 
            android:drawableTop="@drawable/your_image"
            android:checkMark="@drawable/checkbox_blc"/>