EditText setError() with icon but without Popup message

后端 未结 6 1123
你的背包
你的背包 2020-11-27 03:11

I want to to have some validation for my EditText wherein I want to show \"\" icon (that comes when you put editText.setError(\"blah blah\")) but don\'t want th

6条回答
  •  孤城傲影
    2020-11-27 04:07

    Sorry Rajkiran, but your solution is not working on Android 4.2 version. If I am trying to set null value for error, it is not even displayed. The solution I came up was to extend EditText and override setError method. No I have only error indicator without popup.

    @Override
    public void setError(CharSequence pError, Drawable pIcon) {
        setCompoundDrawables(null, null, pIcon, null);
    }
    

提交回复
热议问题