的複選標記我有CheckedTextView選擇:機器人,checkedTextView:不同寬度
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/checkbox_checked" android:state_checked="true"/>
<item android:drawable="@drawable/checkbox_unchecked" android:state_checked="false"/>
</selector>
當我有2個這樣的檢查的文本視圖中的一個低於另一個,第一個被選中時,其他檢查,它看起來像:
您可以注意到,在未選中狀態邊界相比,選中狀態更寬。根據我的資源,這些邊框的寬度相同,但由於需要額外的像素來繪製橙色複選標記,所以檢查的資源更寬。
如何使邊框看起來一樣?有比使用RelativeLayout + TextView +複選框更有效的方法嗎?
UPDATE 1,佈局:
<CheckedTextView
android:id="@+id/saveVideoOnServer"
style="@style/talCell.textView.checked"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/saveVideoOnServer" />
android:background="@android:color/transparent"
<CheckedTextView
android:id="@+id/showMyPosition"
style="@style/talCell.textView.checked"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/showMyPosition" />
它們是垂直線性佈局內。我沒有發佈整個佈局,因爲它是100多行。
你能發佈佈局文件(使用「CheckBox」)?這些九個補丁的圖像? – Luksprog
已添加。這些通常是png,而不是9-patch。 –