Android-CheckBox(复选框)
1.常用属性
android:layout_width=“match_parent/wrap_content/…dp” //跟随父控件/刚好包括它的内容
android:layout_height=“match_parent/wrap_content/…dp”
android:text="@String/…"
android:textSize="…dp"等等属性
例
<CheckBox
android:id="@+id/cb_Android"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tv_title1"
android:text="Android"
android:textSize="20sp"/>
运行效果图
2.自定义样式
1.新建一个selector.xml文件
在drawable文件夹下新建Drawable Resourse File文件,根目录选择selector,文件名自定义
举例文件名为“ bg_check_box.xml”