2013-05-06 22 views
1

我有以下xml代碼:Android - CheckedTextView複選框不符合填充屬性?

看起來好像textview反映到10個dp填充,但是右側的複選框沒有。 textview和複選框不相互對齊。任何人都知道爲什麼複選框不符合10個dp填充?有沒有辦法讓我的textview和複選框對齊?

<CheckedTextView 
    android:id="@+id/nearMeCheckedTextView" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:checkMark="?android:attr/listChoiceIndicatorMultiple" 
    android:clickable="true" 
    android:paddingTop="10dp" /> 

回答

1

嘗試這樣

<CheckedTextView 
    android:id="@+id/nearMeCheckedTextView" 
    android:layout_width="match_parent" 
    android:layout_height="wrap_content" 
    android:checkMark="?android:attr/listChoiceIndicatorMultiple" 
    android:clickable="true" 
    android:padding="10dp" 
    android:gravity="center_vertical" /> 
+1

嗯,I'ved試了一下,還是沒有去。右側的複選框仍然高於我的文本。 – CLDev 2013-05-06 16:53:23

2

見這個例子......爲我工作

<CheckedTextView xmlns:android="http://schemas.android.com/apk/res/android" 
    android:id="@+id/checkedTextViewInterest" 
    android:layout_width="wrap_content" 
    android:layout_height="wrap_content" 
    android:gravity="center_vertical" 
    android:padding="12dp" 
    android:checkMark="?android:attr/listChoiceIndicatorMultiple" 
    />