是否有任何属性可以在不创建单独的文本视图的情况下更改复选框视图中的文本位置?
它一定是这样的
文字------->复选框
这是如何做
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:button="@null"
android:drawableRight="@drawable/checkbox_selector"
android:text="The Label goes here"
/>
诀窍是你必须定义一个drawable选择器,指定所有4个状态的位图,然后使用该选择器作为drawableRight。
这样您就可以在标签的所有4个边上指定复选框(左上角和下边)
像这样对我有用,layoutDirection:
<CheckBox
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="I'm left of the box!!!"
android:layoutDirection="rtl"/>