
android
------解决方案--------------------
没编辑的时候EditView.setEnabled(false);
点编辑后,有两种做法。一种把button上的文字改变下,程序里再记住现在的状态
第二种,把按钮编辑隐藏,保存按钮显示
------解决方案--------------------
设置一个状态值 记录你 当前的 状态时 编辑状态还是 保存状态
public boolean status = false;
public void setStatus(boolean status) //false 为不可编辑 //true为可编辑
{
if(status == true){
edittext1.setenable(ture).....这类的
edittext2.setenable(true).....
button.settext(“编辑”)
}else{
edittext1.setenable(false).....这类的
edittext2.setenable(false).....
button.settext(“保存”)
}
}
button 事件里面处理好这个调用关系和标记位就可以了
------解决方案--------------------
我说了程序里弄个变量记住现在是什么状态