EditText中hint消失

来源:互联网 发布:医疗美容网络 编辑:程序博客网 时间:2024/05/16 09:40
mInfo = (EditText) findViewById(R.id.fabu_info);
mInfo.setOnFocusChangeListener(
new OnFocusChangeListener() {
    
public void onFocusChange(View v, boolean hasFocus) {
        EditText _v
=(EditText)v;
        
if (!hasFocus) {// 失去焦点
            _v.setHint(_v.getTag().toString());
        } 
else {
            String hint
=_v.getHint().toString();
            _v.setTag(hint);
            _v.setHint(
"");
        }
    }

});

singline=true 一行

inputType = 设置输入方式