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

代码中控制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;隐藏按钮