android - AppCompat and EditText different underline on different API -


i'm trying make underline line color change edittext (it used input's validation, must able change in runtime).

i'm using appcompat library. problem on api 21 , above, see transparent black line (gray overlay), instead of bolded version.

how make same in api 16?

i used code change tint:

    final drawable originaldrawable = view.getbackground();     final drawable wrappeddrawable = drawablecompat.wrap(originaldrawable);     drawablecompat.settint(wrappeddrawable, color.red);     setbackground(view,wrappeddrawable); 

pic

solution found adding these lines theme:

    <item name="edittextstyle">@style/base.v7.widget.appcompat.edittext</item>     <item name="edittextbackground">@drawable/abc_edit_text_material</item> 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -