Android游戏开发系统控件-CheckBox
Android游戏开发系统控件-CheckBox
Android游戏开发系统控件-CheckBox
CheckBox是Android系统最普通的UI控件,继承了Button按钮
下面通过一个实例来学习
功能:实现复选框的功能
创建项目“CheckBoxProject”
运行项目效果截图:
代码实现:
=>>main.xml
- <?xml version="1.0" encoding="utf-8"?>
- <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
- android:layout_width="fill_parent"
- android:layout_height="fill_parent"
- android:orientation="vertical" >
- <TextView
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/hello" />
- <CheckBox
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/cb1"
- android:id="@+id/cb1"
- />
- <CheckBox
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/cb2"
- android:id="@+id/cb2"
- />
- <CheckBox
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- android:text="@string/cb3"
- android:id="@+id/cb3"
- />
- </LinearLayout>
|
评论暂时关闭