gpt4 book ai didi

安卓单选按钮 : Remove Left padding

转载 作者:塔克拉玛干 更新时间:2023-11-02 21:10:33 24 4
gpt4 key购买 nike

enter image description here

您好,我遇到了如上所示的问题。我面临的问题是上面列出的单选按钮左侧似乎有一个不可见的填充。我的问题是,这是由于 radio 的可绘制问题,还是我可以调整属性以使其与我的文本和输入字段对齐。如果我需要使用备用可绘制对象,是否可以从 SDK 中获得没有边距/填充的绘制对象?

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
... stuff
<RadioGroup
android:layout_margin="0dp"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RadioButton
android:id="@+id/radio_free_busy"
android:checked="true"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:drawablePadding="0dp"
android:text="@string/label_invitation_free_busy"
/>
<RadioButton
android:id="@+id/radio_free_busy_plus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_invitation_free_busy_plus"
/>
<RadioButton
android:id="@+id/radio_none"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/label_invitation_none"
/>
</RadioGroup>
</LinearLayout>

这似乎是由于 drawable ...如果有人有替代方案会有所帮助

最佳答案

你说得对。我试过了,我添加了一个负边距。

这是结果:

enter image description here

这是我做的:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
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:layout_marginLeft="-3dp"
android:orientation="vertical" >

<RadioButton
android:id="@+id/radio_free_busy"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:drawablePadding="0dp"
android:text="Free busy" />

<RadioButton
android:id="@+id/radio_free_busy_plus"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Invitation free busy plus" />

<RadioButton
android:id="@+id/radio_none"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Invitation none" />
</RadioGroup>

<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="20dp"
android:text="Whate name should people in this group see ?" />

关于安卓单选按钮 : Remove Left padding,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24966681/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com