Android: Lock components in place with soft keyboard

余生长醉 提交于 2021-02-09 14:01:16

问题


The soft keyboard moves a TextView object up with it, (adjusting), and this causes the TextView to overlay another TextView that I'd like to be able to see.

I need a way to lock this TextView specifically, so that the keyboard will overlay it. But only that component. I do not want to pan the entire window, just this one, single, TextView object.

Is there a way to tell the TextView, "Dammit bro, don't move with the keyboard" programmatically?

To be honest, I'd also be willing to settle for keeping all of the components from moving, allowing the keyboard to overlay all of them.

Thanks in advance.


回答1:


So, to answer this, the basic answer is that there is no way to do this.

You can try android:windowSoftInputMode and use "adjustNothing," but apparently this doesn't work (and it didn't work for me either.)

Other than that, you're limited to adjustPan and adjustResize for the soft input repositioning, so you'll have to make your UI accommodate this huge issue.



来源:https://stackoverflow.com/questions/21898018/android-lock-components-in-place-with-soft-keyboard

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!