使用“inputType”设置为“textFilter”,android仍然保留屏幕空间用于建议?
使用 API 7 在这里开发一个 Android 应用程序。我有一个 EditText,我们用它来过滤它下面的列表,因此我们将 inputType 设置为 textFilter,这样 Android 就不会建议单词或自动完成。
但是,当用户键入字符时,他们会看到正在执行搜索缩小的弹出框。尽管建议栏实际上并未显示,但它显然正在变小,以便为建议栏腾出空间。
使用 textNoSuggestions 似乎具有相同的结果。以下是输入框的片段:
<EditText
android:id="@+id/search_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:inputType="textFilter"
android:background="@null"/>
有人经历过并克服了这种行为吗?它不会在 SenseUI 上重现,但可能是因为 SenseUI 浮动建议栏而不是为其占用屏幕空间。
developing an android app here using API 7. I have an EditText that we use to filter down the list beneath it, so we set the inputType to textFilter so Android wouldn't suggest words or auto-complete.
However, when the user types a character they see the popup box in which they're doing the search shrink. It is clearly getting smaller to make room for the suggestion bar, even though the suggestion bar doesn't actually show.
Using textNoSuggestions instead appears to have the same result. Here is the snippet for the input box:
<EditText
android:id="@+id/search_edit"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:singleLine="true"
android:inputType="textFilter"
android:background="@null"/>
Has anyone experienced and overcome this behavior? It doesn't repro on SenseUI, but probably because SenseUI floats the suggestion bar instead of claiming screen real estate for it.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试textNoSuggestions。我不确定 textFilter 的作用,我希望用它来将十六进制键盘的输入限制为 0-9 和 AF,但发现了这个。
Try textNoSuggestions. I'm not sure what textFilter does, I was hoping to use it to limit input to 0-9 and A-F for a hex keyboard, but found this instead.
根据我的经验,唯一一致工作的是textVisiblePassword。这既可以防止自动更正,也不会改变字段的大小。很烦人。
The only thing that works consistently in my experience is textVisiblePassword. This both prevents autocorrection and doesn't change the size of the field. Very annoying.