Android EditText Hint

后端 未结 4 1929
伪装坚强ぢ
伪装坚强ぢ 2020-11-30 06:40

I have set a hint for an EditText, currently the hint visibility is gone. When a user starts typing, I want to remove the hint text, when the cursor is visible

4条回答
  •  自闭症患者
    2020-11-30 07:05

    et.setOnFocusChangeListener(new View.OnFocusChangeListener() {
            @Override
            public void onFocusChange(View v, boolean hasFocus) {
    
                et.setHint(temp +" Characters");
            }
        });
    

提交回复
热议问题