Question

Just a quick simple question, I am using CheckedTextView and I was wondering what, if any, line of code I could use to place the check box on the left side instead of the right side.

Here is my current CheckedTextview Code:

<CheckedTextView
    android:id="@+id/ootChild"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="25dp"
    android:textSize="17sp"
    android:checkMark="@drawable/btn_check_off"
    android:clickable="true"
    android:checked="false" 
    android:onClick="toggle"/>

If there isn't an easy or quick way to do it I can always just use a CheckBox and TextView and place them how I want them.

Was it helpful?

Solution

Add android:drawableLeft="?android:attr/listChoiceIndicatorMultiple" as an XML attribute on your CheckedTextView.

OTHER TIPS

Use the following syntax:

<CheckedTextView
    android:id="@+id/ootChild"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginLeft="25dp"
    android:textSize="17sp"
    android:checkMark="@drawable/btn_check_off"
    android:clickable="true"
    android:checked="false"
    android:onClick="toggle"
    android:drawableLeft="?android:attr/listChoiceIndicatorMultiple" />
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top