Ryker.Wang
Ryker.Wang

Reputation: 797

how to align the text in CheckedTextView with checkbox

My definition XML is:

<CheckedTextView android:textSize="18.0dip" 
    android:text="@string/text" 
    android:textColor="@color/white" 
    android:id="@+id/test" 
    android:layout_width="fill_parent" 
    android:layout_height="wrap_content" 
    android:checkMark="?android:attr/textCheckMark" />

Everything works fine but the text always at the top left of the view and the checkbox is center vertical. They are not at the same line. How to align them.

Upvotes: 9

Views: 9678

Answers (1)

Shaiful
Shaiful

Reputation: 5673

add this line

android:gravity="center_vertical"

Upvotes: 20

Related Questions