Android:使用软键盘将组件锁定到位 [英] Android: Lock components in place with soft keyboard

查看:19
本文介绍了Android:使用软键盘将组件锁定到位的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

软键盘将一个 TextView 对象向上移动(调整),这会导致 TextView 覆盖另一个我希望能够看到的 TextView.

我需要一种方法来特别地锁定这个TextView,以便键盘覆盖它.但只有那个组件.我不想平移整个窗口,只想平移这个单一的 TextView 对象.

有没有办法以编程方式告诉 TextView,该死的兄弟,不要用键盘移动"?

老实说,我也愿意让所有组件都不动,让键盘覆盖所有组件.

提前致谢.

解决方案

所以,要回答这个问题,基本的答案是没有办法做到这一点.

您可以尝试 android:windowSoftInputMode 并使用adjustNothing,",但显然这不起作用(对我也不起作用.)>

除此之外,您只能使用 adjustPanadjustResize 进行软输入重新定位,因此您必须让您的 UI 适应这个巨大的问题.

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.

解决方案

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.

这篇关于Android:使用软键盘将组件锁定到位的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆