标签:
Android问题集锦Ⅰ:http://www.cnblogs.com/AndroidJotting/p/4608025.html
EditText输入内容改变事件监听
_edit.addTextChangedListener (new TextWatcher(){ @Override public void afterTextChanged (Editable s) { // TODO Auto-generated method stub } @Override public void beforeTextChanged (CharSequence s, int start, int count, int after) { // TODO Auto-generated method stub } @Override public void onTextChanged (CharSequence s, int start, int before, int count) { // TODO Auto-generated method stub //关键是这里,监听输入的字符串,如果大于零,则可点击,enable. if(s.length()>0){ _ok.setClickable(true); _ok.setEnabled(true); }else{ _ok.setClickable(false); _ok.setEnabled(false); } } });
在代码中设置TextView的颜色
productState.setTextColor(context.getResources().getColor(R.color.product_value_price_color));
标签:
原文地址:http://www.cnblogs.com/AndroidJotting/p/4777752.html