首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >Android :单选按钮中的按钮和左边框

Android :单选按钮中的按钮和左边框
EN

Stack Overflow用户
提问于 2019-02-01 06:38:44
回答 1查看 246关注 0票数 0

有没有办法在无线电波圈和左边框之间留出空格?我试着给边距,但它不工作,我也试着给填充,但它增加了文本和按钮之间的间距。

无线xml代码:

代码语言:javascript
运行
AI代码解释
复制
<LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal">

        <RadioGroup
            android:id="@+id/radioGroup1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <RadioButton
                android:id="@+id/chkIos"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="@dimen/_12sdp"
                android:layout_marginLeft="@dimen/_12sdp"
                android:layout_marginEnd="@dimen/_5sdp"
                android:layout_marginRight="@dimen/_5sdp"
                android:layout_weight="1"
                android:background="@drawable/option_layout"
                android:button="@drawable/custom_checkbox"
                android:gravity="center"
                android:padding="@dimen/_12sdp"
                android:text="1211asd3"
                android:textColor="@color/black" />


            <RadioButton
                android:id="@+id/radio1"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:background="@drawable/option_layout"
                android:button="@drawable/custom_checkbox"
                android:layout_marginStart="@dimen/_42sdp"
                android:padding="@dimen/_12sdp"
                android:text="RadioButton2"
                android:layout_marginLeft="@dimen/_42sdp" />


            <!--<TextView-->
            <!--android:layout_weight="1"-->
            <!--android:layout_width="match_parent"-->
            <!--android:layout_height="wrap_content" />-->
        </RadioGroup>
    </LinearLayout>

有谁知道怎么做吗?

EN

回答 1

Stack Overflow用户

发布于 2019-02-01 07:10:10

尝试从导入图像,而不是直接将图像粘贴到可绘制的文件夹中

代码语言:javascript
运行
AI代码解释
复制
File -> new -> Image Asset

它将向您显示以下对话框,您需要在其中选择图标类型作为操作栏和选项卡图标,并使用填充控件添加填充。默认图标中有一些填充,尝试添加至少5%的填充,如果需要更多空间,请更改值

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54474165

复制
相关文章

相似问题

领券
社区富文本编辑器全新改版!诚邀体验~
全新交互,全新视觉,新增快捷键、悬浮工具栏、高亮块等功能并同时优化现有功能,全面提升创作效率和体验
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文