Solution of automatic pop-up of Android shielding soft keyboard

Problem overview

The soft keyboard will pop up when inputting content in the edit box, and the limited screen area of the mobile phone often covers the input interface. Let's take a look at the problem rendering first:

When entering the user name and password, the system will pop up the keyboard, causing the problem that the system keyboard will block the text box, as shown in the figure:

When entering the password, the input box is blocked by the system keyboard, which greatly reduces the user operation experience. This is a very common problem of soft keyboard blocking in development. How to solve it?

Simple solution

Method 1:

Write this code before setcontentview in oncreate in your activity

Method 2:

Add the following to the EditText property:

As follows:

The above is the solution of Android shielding soft keyboard automatic pop-up introduced by Xiaobian. I hope it will help 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
分享
二维码
< <上一篇
下一篇>>