如何将CheckedTextView中的文本与复选框对齐

Ryk*_*ang 9 android android-layout android-view

我的定义XML是:

<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" />
Run Code Online (Sandbox Code Playgroud)

一切正常,但文本始终位于视图的左上角,复选框位于中心垂直位置.他们不在同一条线上.如何对齐它们.

Sha*_*ful 20

添加此行

android:gravity="center_vertical"