Question

Juste une petite question simple, je suis en utilisant CheckedTextView et je me demandais ce que, le cas échéant, de la ligne de code que je pourrais utiliser à la place de la case à cocher sur la gauche au lieu de droite.

Ici est mon 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"/>

Si il n'est pas facile ou moyen rapide de le faire, je peux toujours utiliser une Case à cocher et TextView et de les placer comment je les veux.

Était-ce utile?

La solution

Ajouter android:drawableLeft="?android:attr/listChoiceIndicatorMultiple" comme un attribut XML sur votre CheckedTextView.

Autres conseils

Utilisez la syntaxe suivante:

<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" />

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top