Android的 - 调整屏幕键盘时,弹出?弹出、屏幕、键盘、Android

2023-09-06 03:07:30 作者:走路太骚会闪腰

我希望能够调整自己的UI屏幕在Android上时软键盘弹出。

I want to be able to adjust my UI screen on Android when the soft keyboard pops up.

所以,在一分钟我有类似的东西下面,我已经和的EditText在屏幕的底部,当用户点击的EditText我想要的一样,在第二张图片会发生什么的第一张照片。

So at the minute I have something similiar to the first picture below where I have and EditText at the bottom of the screen and when a user taps the EditText I want the same as what happens in the second picture.

这就是EditText上被移动了,似乎在软键盘,当软键盘自败它应该然后返回到先前的状态之上坐。

That is that the EditText gets moved up and appears to "sit" on top of the soft keyboard, when the soft keyboard dissapears it should then return to its prior state.

任何人都可以让我知道接近和实现这一目标的最佳方式是什么?

Can anyone let me know the best way to approach and implement this?

推荐答案

您需要添加安卓windowSoftInputMode =adjustResize你在AndroidManifest.xml文件中的标记

You need to add android:windowSoftInputMode="adjustResize" to your tag in the AndroidManifest.xml file.