How to hide underbar in EditText

后端 未结 25 1984
温柔的废话
温柔的废话 2020-11-28 00:52

How can I hide the EditText underbar (the prompt line with little serifs at the ends)?

There might be a better way to do what I want: I have a layout with an EditTe

25条回答
  •  自闭症患者
    2020-11-28 01:06

    If you want this to affect all instances of EditText and any class that inherits from it, then you should set in your theme the value for the attribute, editTextBackground.

      @drawable/bg_no_underline
    

    An example of the drawable I use is:

    
        
          
        
    
    

    This is slightly modified version of what the default material design implementation is.

    When applied it will make all your EditText remove the underline throughout the app, and you don't have to apply the style to each and every one manually.

提交回复
热议问题