2021
07-17
07-17
Android单选按钮RadioButton的使用方法
单选按钮要在一组中选择一项,并且不能多选。同一组RadioButton要放在同一个RadioGroup节点下。RadioButton默认未选中,点击后选中但是再次点击不会取消选中。RadioButton经常会更换按钮图标,如果通过button属性变更图标,那么图标与文字就会挨得很近。为了拉开图标与文字之间的距离,得换成drawableLeft属性展示新图标(不要忘记把button改为@null),再设置drawablePadding即可指定间隔距离。复现代码时出现了一个错误,处理单...
继续阅读 >
本文实例为大家分享了Android控件RadioButton的使用代码,供大家参考,具体内容如下内容<?xmlversion="1.0"encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"android:layout_width="match_parent"android:layout_height="match_parent"tools:cont...