“缺少 autofillHints 属性”

新手上路,请多包涵

我对 Palette -> Text

当我想设置一些视图时,我收到一条消息问题 "Missing autofillHints attribute"

有什么建议么?

原文由 Sebastian 发布,翻译遵循 CC BY-SA 4.0 许可协议

阅读 4.1k
1 个回答

也许您正在使用 EditTextautofillHints 在 API 26 及更高版本中用于填充空 EditText s,它实际上是在建议应该在其中放置哪种类型的内容。

只需添加:

 android:autofillHints="username" // the type of content you want

到您的 EditText 警告将消失。

You do this using the new android:autofillHints attribute to tell autofill what type of content you expect , and android:importantForAutofill to tell autofill which views you想要(或不想)被填满。

阅读: https ://medium.com/@bherbst/getting-androids-autofill-to-work-for-you-21435debea1

这: https ://developer.android.com/guide/topics/text/autofill-services


编辑:

但是,您可以设置:

 android:importantForAutofill="no"

告诉组件填充和消除错误并不重要。

原文由 ʍѳђઽ૯ท 发布,翻译遵循 CC BY-SA 4.0 许可协议

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题