如何实现android中三个单选按钮横向排列且只能选一个?

android中怎样设置单选按钮的大小?... android中怎样设置单选按钮的大小? 展开
 我来答
百度网友428c7bf
推荐于2017-10-02 · 超过20用户采纳过TA的回答
知道答主
回答量:81
采纳率:0%
帮助的人:45.6万
展开全部

在RadioGroup中 设置一个属性android:orientation="horizontal"

求满意!

 

 

 

在RadioButton中设置一个android:textSize="50dp" 单选按钮随文字大小而变化!

追问

嗯,谢谢你,但是单选按钮好像不会随文字的大小变化而变化吧

你看,字体大的跟字体小的它们的按钮还是一样大呀

DobbinYuan
推荐于2017-09-22 · TA获得超过522个赞
知道小有建树答主
回答量:523
采纳率:0%
帮助的人:182万
展开全部
<RelativeLayout
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:layout_marginTop="@dimen/row_item_margin">

    <TextView
        android:id="@+id/tvStorageWay"
        style="@style/EditTextStyle"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:text="储存方式:" />

    <RadioGroup
        android:id="@+id/rgStorageWay"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerVertical="true"
        android:layout_toRightOf="@id/tvStorageWay"
        android:gravity="center_vertical"
        android:orientation="horizontal">

        <RadioButton
            android:id="@+id/rbPack"
            style="@style/EditTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:button="@null"
            android:drawableLeft="@drawable/selector_login_mode_radiobutton"
            android:text="包装" />

        <RadioButton
            android:id="@+id/rbBulk"
            style="@style/EditTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/row_item_margin"
            android:layout_weight="1"
            android:button="@null"
            android:drawableLeft="@drawable/selector_login_mode_radiobutton"
            android:text="散装" />

        <RadioButton
            android:id="@+id/rbStorageWayOther"
            style="@style/EditTextStyle"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginLeft="@dimen/row_item_margin"
            android:layout_weight="1"
            android:button="@null"
            android:drawableLeft="@drawable/selector_login_mode_radiobutton"
            android:text="其它" />
    </RadioGroup>
</RelativeLayout>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
adekof14
2015-11-12 · TA获得超过3728个赞
知道小有建树答主
回答量:3017
采纳率:96%
帮助的人:366万
展开全部

在RadioGroup中 设置一个属性android:orientation="horizontal"

求满意!

 

 

 

在RadioButton中设置一个android:textSize="50dp" 单选按钮随文字大小而变化!

已赞过 已踩过<
你对这个回答的评价是?
评论 收起
信仰l弑天地
2015-08-19 · TA获得超过1.1万个赞
知道大有可为答主
回答量:3973
采纳率:0%
帮助的人:1566万
展开全部
在RadioGroup中 设置一个属性android:orientation="horizontal"
求满意!

在RadioButton中设置一个android:textSize="50dp" 单选按钮随文字大小而变化!
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
银潇兮
2015-09-17 · TA获得超过5527个赞
知道小有建树答主
回答量:1201
采纳率:100%
帮助的人:267万
展开全部
可以用fragment实现或者用选项卡。横向排列用LinearLayout
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(6)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式