简体   繁体   English

EditText上。 红色光标和下划线

[英]EditText. Red cursor and underline

When creating an EditText for a form, The cursor and underline appears in red. 为表单创建EditText时,光标和下划线显示为红色。

手机gif

How solve this? 如何解决呢?

After finding this solution I added: 找到解决方案后,我添加了:

android:inputType="phone|textNoSuggestions"

Change your theme's accent color to white, to change the color of this line and cursor. 将主题的强调色更改为白色,以更改该线条和光标的颜色。 Your accent color is set to red right now. 您的强调色现在设置为红色。

To do this, go to styles.xml and check what your main App theme's "colorAccent" is pointing to. 为此,请转到styles.xml并检查您的主应用程序主题的“ colorAccent”指向的内容。 Probably it is pointing to '@color/accent' like this: 可能是这样指向“ @ color / accent”:

<style name="AppTheme" ... >
    <item name="android:colorAccent">@color/accent</item>
    ...

To then update the accent color of your app, change your 'accent' (or whatever id it has for you in the styles.xml) in colors.xml to white, like this: 然后,要更新应用程序的强调色,请将colors.xml中的“强调”(或在styles.xml中为您提供的任何ID)更改为白色,如下所示:

<color name="accent">@android:color/white</color>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM