TextInputLayout and EditText double hint issue

后端 未结 7 2263
生来不讨喜
生来不讨喜 2021-02-11 19:34

I want to set the hint with java in EditText(which is in TextInputLayout).

Code used for setting hint:

aET = (EditText) findViewById(R.id.

7条回答
  •  梦谈多话
    2021-02-11 20:11

    Simple use this programmatically it's working for me

        TextInputLayout til = new TextInputLayout(this);
        til.setHintTextAppearance(android.R.style.TextAppearance_Large);
    

    You can customize the style as i mention below...

    
    
    TextInputLayout til = new TextInputLayout(this);
            til.setHint("hai);
            til.setHintTextAppearance(R.style.TextInputLayout);
    

提交回复
热议问题