单选框的页面布局

发布时间:2022-06-21 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了单选框的页面布局脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。
 1 <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
 2     android:layout_width="match_parent"
 3     android:layout_height="match_parent">
 4 
 5     <RadioGroup
 6         android:id="@+id/rg_1"
 7         android:layout_width="wrap_content"
 8         android:layout_height="wrap_content"
 9         android:orientation="vertical"
10         android:padding="20dp">
11         <RadioButton
12             android:id="@+id/rb_1"
13             android:layout_width="wrap_content"
14             android:layout_height="wrap_content"
15             android:text="女"
16             android:checked="true"
17             android:textSize="30sp"
18             android:textColor="#FF9900"
19             android:padding="10dp"/>
20         <!--checked默认为-->
21 
22         <RadioButton
23             android:id="@+id/rb_2"
24             android:layout_width="wrap_content"
25             android:layout_height="wrap_content"
26             android:text="男"
27             android:textSize="30sp"
28             android:textColor="#FF9900"
29             android:padding="10dp"/>
30     </RadioGroup>
31 
32     <RadioGroup
33         android:id="@+id/rg_2"
34         android:layout_width="wrap_content"
35         android:layout_height="wrap_content"
36         android:orientation="horizontal"
37         android:layout_below="@id/rg_1"
38         android:layout_marginTop="20dp">
39         <RadioButton
40             android:id="@+id/rb_3"
41             android:layout_width="120dp"
42             android:layout_height="40dp"
43             android:gravity="center"
44             android:text="女"
45             android:checked="true"
46             android:background="@drawable/select_radiobutton"
47             android:button="@null"
48             android:textSize="30sp"
49             android:textColor="#000" />
50         <!--checked默认为-->
51 
52         <RadioButton
53             android:id="@+id/rb_4"
54             android:layout_width="120dp"
55             android:layout_height="40dp"
56             android:gravity="center"
57             android:text="男"
58             android:layout_marginLeft="20dp"
59             android:button="@null"
60             android:background="@drawable/select_radiobutton"
61             android:textSize="30sp"
62             android:textColor="#000" />
63         <!--@null是不用原来的选择样式-->
64 
65     </RadioGroup>
66 </RelativeLayout>

 

脚本宝典总结

以上是脚本宝典为你收集整理的单选框的页面布局全部内容,希望文章能够帮你解决单选框的页面布局所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: