gpt4 book ai didi

android - 如何在android中禁用EditText自动建议

转载 作者:太空宇宙 更新时间:2023-11-03 10:34:26 25 4
gpt4 key购买 nike

所以情况是,在我们应用程序的登录屏幕中,当用户在“电话号码”框上提示时,其中一个用户的电话总是弹出他的电话号码作为建议。像这张图片: enter image description here

只有他的设备 (Google Pixel 2) 有这个弹出框。所有其他安卓测试或日常使用的设备都没有这个弹出窗口。我尝试了几种方法来关闭弹出窗口,但没有一种有效。

XML:

<EditText
android:id="@+id/phone_number"
android:background="@null"
android:layout_marginLeft="15dp"
android:layout_width="match_parent"
android:hint="@string/phone_num"
android:inputType="textVisiblePassword|textNoSuggestions|textFilter|phone"
android:layout_height="50dp" />

java 文件:phone_number.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD);

我不知道是什么导致了这个弹出窗口以及如何隐藏它。如果您知道解决方案及其背后的原因。请帮我。非常感谢!

最佳答案

只写答案 Maxim,因为他在评论中没有注意到:

android:importantForAutofill="noExcludeDescendants"

在纯 Android 手机上提供帮助。

关于android - 如何在android中禁用EditText自动建议,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49744160/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com