复选框ChekcBox
来源:互联网 发布:eva分析软件 编辑:程序博客网 时间:2024/05/29 09:17
复选框ChekcBox
<CheckBox android:id="@+id/checkBox_music" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="音乐" /><CheckBox android:id="@+id/checkBox_history" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="历史" /><CheckBox android:id="@+id/checkBox_art" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="美术" />
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); // 关联布局文件 setContentView(R.layout.activity_main); mCheckBoxArt = (CheckBox) findViewById(R.id.checkBox_art); mCheckBoxHistory = (CheckBox) findViewById(R.id.checkBox_history); mCheckBoxMusic = (CheckBox) findViewById(R.id.checkBox_music); myCheckBoxSelected = new MyCheckBoxSelected(); mCheckBoxArt.setOnCheckedChangeListener(myCheckBoxSelected); mCheckBoxHistory.setOnCheckedChangeListener(myCheckBoxSelected); mCheckBoxMusic.setOnCheckedChangeListener(myCheckBoxSelected); } class MyCheckBoxSelected implements OnCheckedChangeListener { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { if (isChecked) { String text = buttonView.getText().toString(); Log.e("选中了", text); } } }
0 0
- 复选框ChekcBox
- 带chekcbox功能的下拉框
- 复选框,复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- 复选框
- checkbox复选框 翻页复选
- 自定义复选框,复选框样式修改,重写复选框
- 自定义复选框,复选框样式修改,重写复选框
- 选中复选框,取消选中复选框
- Unity 安卓手机 AssetBundle.LoadFromFile() SerializedFile占用大量内存
- Java复习总结——框架篇(三)
- 造轮子去了
- Vmware桥接模式下主机和和虚机间为何互相ping不通
- 基本数据类型以及变量的定义
- 复选框ChekcBox
- bootstrap里面的radio怎么写
- 滚动到底加载
- 前端必读:浏览器内部工作原理
- 第一章 Ajax基本工作原理剖析
- MVC框架的运用
- Javamail简单示例
- C语言---那些容易被忽略的细节
- 集成百度语音合成的一些问题