在我的 android 代码中,我有这个
<CheckedTextView
android:id="@+id/rememberMe"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignRight="@+id/advancedMenu"
android:layout_below="@+id/logInMode"
android:checkMark="@drawable/bg_checkbox"
android:gravity="center|center_horizontal"
android:text="@string/rememberMe"
android:textColor="#ffffff" />
并且bg_checkbox
是
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked"
android:state_focused="false">
</item>
<item android:state_checked="true"
android:drawable="@drawable/checkbox_checked"
android:state_focused="true">
</item>
<item android:state_checked="false"
android:drawable="@drawable/checkbox"
android:state_focused="false">
</item>
<item android:state_checked="false"
android:drawable="@drawable/checkbox"
android:state_focused="true">
</item>
</selector>
此选择器适用于常规复选框,但为此,它不起作用,即使我单击它,它也只是显示未选中状态。
另外,如何在文本和复选框之间放置一些空格?