需要有关单选按钮的帮助
我的xml
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="0dp"
android:minWidth="0dp"
android:text="Hello" />
<RadioButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="0dp"
android:text="World" />
</RadioGroup>
</LinearLayout>
在圆形和线性布局左侧之间的左侧有这个空间。我如何摆脱那个空间?在 TextViews 中,将 minWidth 设置为 0dp 可以解决问题,但我无法为 RadioButtons 做到这一点。任何想法
最佳答案
方法不多,你可以试试这个
<RadioGroup
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:layout_marginLeft="-10dp"
>
... android:layout_marginLeft="-10dp"
它能满足您的需求吗?
关于Android单选按钮左填充为0,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24190564/