Android单选按钮方向

4

我该如何在我的应用中将单选按钮的方向更改为rtl?

(按钮靠右,文本靠左)

我不想让单选按钮失去其材料设计。


1
请发布你已经完成的代码 :) - Anil Meenugu
我用了一个技巧,在所有带有默认 UI 和默认选择行为的 SDK 中实现了这一点,请参考下面的答案:https://dev59.com/SWMk5IYBdhLWcg3w2RaT#42734740 - SiSa
2个回答

3
使用android:drawableRight="?android:attr/listChoiceIndicatorSingle"。
 <RadioButton
       android:id="@+id/radioButton"
       android:layout_width="wrap_content"
       android:layout_height="wrap_content"
       android:button="@null"
       android:text="rtl button"
       android:drawableRight="?android:attr/listChoiceIndicatorSingle"/>

0
<RadioButton
    android:id="@+id/radioButton"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:text="item"
    android:layoutDirection="rtl"/>

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接