- 开发中业务需求总是千奇百怪(搞不懂产品经理脑壳里装的什么),有时候写布局的话可以直接在xml文件中完成,但是有时候业务需求,有些布局是是动态变化的,不是setvisibily就可完成的,这个时候就要考虑通过代码来添加子布局了。
常规使用的话:
直接在xml布局文件中写,button属性是为了去除系统自带的圆圈
<RadioGroup android:id="@+id/rg" android:orientation="horizontal" android:layout_width="match_parent" android:layout_height="wrap_content"> <RadioButton android:id=