android 复选框下方的文本

Text underneath the android checkbox

我知道我们可以有一个 Checkbox,它下面有一个独立的 textView,但是我们可以有一个作为复选框一部分的文本出现在复选框下方吗?

如果是,是否可以通过 Android UI 而不是通过编程来实现?

可以使用 CheckedTextView:

<CheckedTextView
    android:drawableTop="@drawable/checkmark"
    android:checked="true"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="Checked text"/>

还有一个选择器:

<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/unchecked" android:state_checked="false"></item>
<item android:drawable="@drawable/checked"></item></selector>