您的位置:首页 > 移动开发 > Android开发

Android之RadioButton多行

2015-09-22 15:50 549 查看
RadioGroup设置orientation="vertical"竖向单列显示

RadioGroup设置orientation="horizontal"横向单行显示

如何实现多行多列RadioButton呢?

<com.hz.w504_sing_common.FlowRadioGroup
android:id="@+id/radioGroup"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"  >
<LinearLayout
android:layout_marginTop="10dip"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >

<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="0" />
<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="5" />
<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="10" />
<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="15" />

</LinearLayout>

<LinearLayout

android:layout_marginTop="10dip"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="horizontal" >

<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="20" />
<RadioButton

android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="25" />
<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="30" />
<RadioButton
android:layout_width="0dip"
android:layout_weight="1"
android:layout_height="wrap_content"
android:text="35" />
</LinearLayout>
</com.hz.w504_sing_common.FlowRadioGroup>


布局
哦了
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: