除了继承和创建自定义的RadioButton这种方法外,还有别的方法可以实现在RadioGroup视图中的RadioButton下面添加TextView吗?
2条回答
- hxn_217 2012-10-08 03:24关注
你可以从XML中移除RadioGroup,一个一个添加radio button。使用如下代码可以实现:
<?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <RadioButton android:id="@+id/radioButton1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/radioGroup1" android:text="RadioButton" /> <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/radioButton1" android:text="Large Text" android:textAppearance="?android:attr/textAppearanceLarge" /> <RadioButton android:id="@+id/radioButton2" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignLeft="@+id/textView1" android:layout_below="@+id/textView1" android:text="RadioButton" /> </RelativeLayout>
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报
悬赏问题
- ¥15 怀疑手机被监控,请问怎么解决和防止
- ¥15 Qt下使用tcp获取数据的详细操作
- ¥15 idea右下角设置编码是灰色的
- ¥15 全志H618ROM新增分区
- ¥15 在grasshopper里DrawViewportWires更改预览后,禁用电池仍然显示
- ¥15 NAO机器人的录音程序保存问题
- ¥15 C#读写EXCEL文件,不同编译
- ¥15 MapReduce结果输出到HBase,一直连接不上MySQL
- ¥15 扩散模型sd.webui使用时报错“Nonetype”
- ¥15 stm32流水灯+呼吸灯+外部中断按键