Android method for changing EditText underline color style

preface

As we all know, when using appcompatedittext (edit text), the default underline follows the system's #ff4081 color value. You can change all color styles by changing this value

Sometimes you want to define the color style of an interface separately, you can do this:

1. Add the latest appcompat library to your build.gradle

2. Let your activity inherit android.support.v7.app.appcompatactivity

3. Declare your EditText in any layout.xml file

4. Declare custom styles in the styles.xml file

5. Apply this style to your EditText through the Android: theme attribute

The effects are as follows:

summary

The above is all about Android changing the underline color style of EditText. I hope the content of this article can bring some help to your study or work. If you have any questions, you can leave a message.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>