在EditText中键入单词时删除下划线

问题描述 投票:0回答:1

我知道,这个论坛上已经问过很多问题了,但是没有答案对我有用...当我在其中一个EditText中编写文字时,所写的单词带有下划线,但我希望不要下划线...我已经看到了诸如“您必须更改android:background”或“您拥有将textNoSuggestions属性放入android:inputType“ ......但是我已经完成了所有操作-看到下面的代码-(并且我甚至默认保留它们),它不起作用。

非常感谢所有愿意花时间回答这个问题的人!

XML EditText:

<EditText
            android:id="@+id/editP1"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical"
            android:layout_margin="4dp"
            android:autofillHints="username"
            android:background="@drawable/background_card"
            android:gravity="center_horizontal"
            android:hint="@string/player_name"
            android:imeOptions="flagNoFullscreen"
            android:inputType="textFilter|textNoSuggestions"
            android:maxLength="12"
            android:padding="4dp"
            android:textSize="25sp" />
<!-- The ' android:imeOptions = "flagNoFullscreen" ' was only necessary to show the underline word since my app is always in landscape mode -->

图片:The 2 EditTexts with one of them underligne to cursor.

android android-studio android-layout android-edittext
1个回答
0
投票

Android edittext is underlined when typing所述,这可能是所使用键盘的功能,而不是EditText。不知道您尝试过和失败了哪些特定解决方案(您说没有答案对您有用,但是没有列出您尝试过的事情),很难提出具体建议,但是我建议

android:inputType="textVisiblePassword|textNoSuggestions"

选项,看看是否可行。密码通常应阻止键盘提示内容(因为通常没有建议可用于密码)。

© www.soinside.com 2019 - 2024. All rights reserved.