需求是输入点额才出现确定按钮,因此要监听EditText的输入。而EditText的监听输入是:
priceReplyE.addTextChangedListener(new TextWatcher() { @Override public void onTextChanged(CharSequence s, int start, int before, int count) { yesBtn.setVisibility(Button.VISIBLE); } @Override public void beforeTextChanged(CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void afterTextChanged(Editable s) { // TODO Auto-generated method stub } }); }
上面的yestBtn.setVisisblility是设置按钮显示。