首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

代码中统制Button的显示隐藏和禁用

2012-07-22 
代码中控制Button的显示隐藏和禁用设置Button属性Button editbut (Button)findViewById(R.id.editBtn)e

代码中控制Button的显示隐藏和禁用
设置Button属性

Button editbut = (Button)findViewById(R.id.editBtn);editbut.setText("修    改");editbut.setVisibility(View.VISIBLE);//显示按钮editbut.setEnabled(false);//false:禁用按钮;true:不禁用

View.VISIBLE:显示按钮
View.GONE;隐藏按钮

热点排行