Problems encountered in Android pop-up soft keyboard and Solutions

Demo download

Important code:

remarks:

Full screen mode:

1. Set the full screen through style or setflags (...);

2. Activity setting in androidmanifest.xml: Android: windowsoftinputmode = "adjustresize";

3. This layout must be the outermost layout of the layout;

4. Be sure to add a view in the layout, as follows:

5. Set the view to be adjusted through setadjustview (view view);

6. In full screen mode, the input box is not displayed until the soft keyboard pops up. Because if the input box is displayed at the beginning, the soft keyboard will pop up according to the input box, and the input box is at the bottom, which may cause the whole view to top up. So at this time, we should implement the oninputviewvisiblelistener interface to control the display and hiding of the input box.

Non full screen mode

1. Activity setting in androidmanifest.xml: Android: windowsoftinputmode = "adjustresize";

2. This layout must be the outermost layout of the layout;

3. Set the view to be adjusted through setadjustview (view view);

4. If you need to control the display and hiding of the input box, implement the oninputviewvisiblelistener interface.

The above is the pit and solution of Android pop-up soft keyboard 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
分享
二维码
< <上一篇
下一篇>>