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つある場合、最初のビューはチェックされておらず、もう1つはチェックされています。次のようになります。
チェックされていない状態の境界線は、チェックされている状態に比べて広いことがわかります。私のリソースによると、これらの境界線は同じ幅ですが、オレンジ色のチェックマークを描画するために余分なピクセルが必要なため、チェックされたリソースはより広くなっています。
境界線を同じように見せるためにどうすればよいですか?RelativeLayout + TextView +チェックボックスを使用するよりも効率的な方法はありますか?
更新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行以上あるためです。