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);
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
Post a Comment