android 禁用移动到下一个字段
在我的 Android 应用程序中,我有几个线性布局的 editText。然后我在它们下面有几个采用相同线性布局的旋转器。如果选择了微调器项目,它将跳回编辑文本字段之一。我将其与填写网络表单时按 Tab 进行比较,它会自动跳转到下一个字段。这没什么问题,除非它跳回靠近布局顶部的位置,并且用户必须向下滚动才能单击提交按钮。有没有办法禁用自动移动,以便应用程序不会强制移动到下一个字段?
In my android application I have several editTexts in a linear layout. Then I have several spinners below them in the same linear layout. If a spinner item is selected it jumps back up to one of the edit text fields. I would compare it to pressing tab when your filling out a webform, it automatically jumps to the next field. That would be fine except it jumps back closer to the top of the layout and the user has to scroll back down to click the submit button. Is there any way to disable the automatic move so the application won't force a move to the next field?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我不知道是否有一种简单的方法可以完全禁用它。 设置属性来控制接下来获得焦点的视图
但是您可以通过在布局 xml 中 。您可以将它们设置为“@+id/idOfTheNextView”
I don't know if there is an easy way to disable it entirely. But you can control which views get focus next by setting the
attributes in your layout xml. You would set them ="@+id/idOfTheNextView"
虽然这里晚了好几年,但您可以在 EditText 上使用此设置
Although late by years here but you can use this setting on the EditText