首页
友链
壁纸
留言
今日热榜
更多
关于
时光
推荐
精品流量卡
Search
1
都二十多年了,你的梦为什么还没碎!
57,085 阅读
2
2022年5个好用的 BT/ 磁力链接下载工具推荐 |Windows 、安卓系统
37,328 阅读
3
nps内网穿透实现外网访问树莓派
32,418 阅读
4
实践利用宝塔建emlog个人博客-超详细【原创】
26,129 阅读
5
Typecho-Joe-Theme主题帮助文档
24,602 阅读
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
登录
Search
标签搜索
PHP
HTML
API
Javascript
源码
JS
Vue
Github
CloudFlare
接口
函数
SQL
ASP.NET
MVC
EF
T4模板
后台管理
CDN
微信小程序
MAC
韩小韩
累计撰写
261
篇文章
累计收到
1,303
条评论
首页
栏目
闲杂乱码
Python
网站源码
微信小程序
娱乐分享
Is相册
软件工具
页面
友链
壁纸
留言
今日热榜
关于
时光
推荐
精品流量卡
搜索到
1
篇与
复选框CheckBox触发
的结果
2019-05-10
安卓Android按钮Button点击和复选框CheckBox选中的监控触发事件
CheckBox复选框和按钮Button的定义,main.xml内容如下:<CheckBox android:id="@+id/checkbox1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="复选框1" /> <Button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="20dp" android:text="按钮1" />JAVA代码如下:btn1 =(Button)findViewById(R.id.button1); btn1.setOnClickListener(new Button.OnClickListener(){public void onClick(View arg0) {这里输入点击Button按钮触发的事件}}); CheckBox被选中或取消选中触发事件: checkbox1=(CheckBox)findViewById(R.id.checkbox1); b5.setOnCheckedChangeListener(new OnCheckedChangeListener(){if(checkbox1.isChecked()){这里输入CheckBox复选框选中时触发的事件}else{这里输入CheckBox复选框取消选中时触发的事件}});附:Button超简单监控点击事件按钮Button的定义,main.xml内容如下:<Button android:id="@+id/button1" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_alignParentLeft="true" android:layout_below="@+id/textView1" android:layout_marginTop="20dp" android:text="按钮1" android:onClick="btnOnClick" />JAVA代码如下:public void btnOnClick(){ 这里输入 点击Button按钮触发的事件 }
2019年05月10日
2,347 阅读
0 评论
0 点赞