How to customize EditText field in android using AppCompat v7:21

后端 未结 2 928
青春惊慌失措
青春惊慌失措 2021-01-04 09:08

I\'m using the Appcompatv7 21 and trying to customize the editText field.

Weird thing is that it\'s working fine on lollipop but doesn\'t work on kitkat or any pre-lo

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-04 09:24

    Try to add the next code inside your EditText

    style="@style/Widget.AppCompat.EditText"
    

    Check in real device.

    In my EditText works, this is my EditText:

    
    

    You can check md_text and md_disabled_hint_text colors here: Google Colors

    And this is a v19 style of my app:

    
    

    My EditText is gray when is unfocused, and blue focused, it takes the color from colorAccent.

    It changes color when I change the AppTheme.

提交回复
热议问题