Android realizes dynamic expansion and contraction of landing page logo with keyboard retraction and retraction (perfectly solves the problem of keyboard pop-up blocking controls)

In two recent projects, the project requirements require us to realize / * the content of the login page can be pushed up with the pop-up of the keyboard to avoid the keyboard blocking the login button * / this effect is hard for the baby. I have to toss about what was done in half a day. Well, I compromise. After all, I am still an ape who pays great attention to user experience.

Let's do it. The initial plan is to keep the size of the input box and login button unchanged. Change the size and position of the logo when the keyboard pops up, so as to make room for the keyboard. Of course, restore the keyboard when the keyboard is folded, just like nothing happened. Well, that's right. After saying so much, let's put a picture and feel the effect first:

Next, we'll have dinner. The layout is relatively simple. Just put a suitable linear layout on the outside of the picture, because it will be used to change the position of the logo later. The layout code is as follows:

The main code is as follows. I will add comments to the code. Because it is the code of the whole module, there will also be some other functions in it:

The above is what Xiaobian introduced to you. Android realizes the dynamic expansion and contraction of the landing page logo with the keyboard (perfectly solves the problem of the keyboard pop-up blocking controls). I hope it will be helpful to you. If you have any questions, please leave me a message, and Xiaobian will reply to you in time. Thank you very much for your support for the programming tips website!

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>