RecyclerView在键盘弹出时被推上去 – Android

huangapple 未分类评论42阅读模式
英文:

RecyclerView pushed up when keyboard is launched - Android

问题

我有一个安卓应用,其中主活动包含一个可滚动视图(recyclerView)和一个位于右下角的浮动操作按钮(fab)。当用户点击浮动操作按钮时,会弹出一个警示对话框。

该警示对话框包含多个编辑框,用于接收用户输入。因此,当用户点击编辑框时,键盘会弹出。键盘一弹出,可滚动视图中的项目会在警示对话框的背景中向上移动。我不希望这些项目在背景中向上移动,因为它们会与标题重叠。我的可滚动视图四周都有约束。另外,当键盘消失时,这些项目会恢复到它们的位置。

如何解决这个问题?

英文:

I have an android app where the main activity contains a recyclerView and a fab in the bottom right corner. When the user clicks on the fab,an alert dialog opens.

The alert dialog has several edit text,which takes input from the user. So,the keyboard is launched when the user clicks on the editText. As soon as the keyboard opens,the recylerView items move up in the background of alert dialog. I don't want the items to go up in the background since they overlap with the heading. My recyclerView is constrained from all 4 sides. Also when keyboard is dismissed,the items come back to their position

How do I fix this?

huangapple
  • 本文由 发表于 2020年7月25日 01:48:42
  • 转载请务必保留本文链接:https://java.coder-hub.com/63078924.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定