Android游戏开发系统控件-CheckBox


Android游戏开发系统控件-CheckBox

CheckBox是Android系统最普通的UI控件,继承了Button按钮

下面通过一个实例来学习

功能:实现复选框的功能

创建项目“CheckBoxProject”

运行项目效果截图:

代码实现:

=>>main.xml

  1. <?xml version="1.0" encoding="utf-8"?>  
  2. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"  
  3.     android:layout_width="fill_parent"  
  4.     android:layout_height="fill_parent"  
  5.     android:orientation="vertical" >  
  6.   
  7.     <TextView  
  8.         android:layout_width="fill_parent"  
  9.         android:layout_height="wrap_content"  
  10.         android:text="@string/hello" />  
  11.     <CheckBox  
  12.         android:layout_width="fill_parent"  
  13.         android:layout_height="wrap_content"  
  14.         android:text="@string/cb1"  
  15.         android:id="@+id/cb1"  
  16.         />  
  17.     <CheckBox   
  18.         android:layout_width="fill_parent"  
  19.         android:layout_height="wrap_content"  
  20.         android:text="@string/cb2"  
  21.         android:id="@+id/cb2"  
  22.         />  
  23.     <CheckBox  
  24.         android:layout_width="fill_parent"  
  25.         android:layout_height="wrap_content"  
  26.         android:text="@string/cb3"  
  27.         android:id="@+id/cb3"  
  28.         />  
  29. </LinearLayout>  
  • 1
  • 2
  • 3
  • 下一页

相关内容

    暂无相关文章