Customizing EditText Bottom Line and Accent Colors in Appcompat v7
Question:
In Appcompat v7, is it possible to modify the bottom line and accent colors of EditTexts to align with the Material Design aesthetic?
Answer:
Yes, it's possible to customize the appearance of EditTexts using Appcompat v7. Here's how:
Custom Style Override:
Edit the base theme of your app to override the following values:
<code class="xml"><style name="Theme.App.Base" parent="Theme.AppCompat.Light.DarkActionBar"> <item name="colorControlNormal">#c5c5c5</item> <item name="colorControlActivated">@color/accent</item> <item name="colorControlHighlight">@color/accent</item> </style></code>
Usage:
Change the style associated with your desired activities to Theme.App.Base. The customized EditText appearance will be applied to those activities.
Note:
Unlike previous versions of AppCompat, the values for colorControlActivated, colorControlHighlight, and colorControlNormal are not explicitly declared in styles for Material Design-based EditTexts. By overriding these properties in your base theme, you can control the appearance of these elements.
The above is the detailed content of Can I Customize EditText Bottom Line and Accent Colors in Appcompat v7 for Material Design?. For more information, please follow other related articles on the PHP Chinese website!