Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 812
Ryker.Wang Avatar asked Feb 07 '12 07:02

Ryker.Wang


1 Answers

add this line

android:gravity="center_vertical"

like image 170
Shaiful Avatar answered Nov 15 '22 15:11

Shaiful