Home  >  Article  >  Java  >  Interface control method when Android soft keyboard pops up

Interface control method when Android soft keyboard pops up

高洛峰
高洛峰Original
2017-01-07 11:42:121436browse

The example in this article describes the interface control method when the Android soft keyboard pops up. Share it with everyone for your reference, the details are as follows:

Sometimes the layout changes after the soft keyboard pops up in androidactivity

There are three modes below to change the display form of the soft keyboard after popping up

Mode 1: Compression mode After the soft keyboard pops up, it will be compressed to the original size
We can set the Activity in AndroidManifet.xml. Such as:

android:windowSoftInputMode="stateUnchanged|adjustResize"

Mode 2: Panning mode After the soft keyboard pops up, it will not compress the original size, but overwrite it
We can set the Activity in AndroidManifet.xml. For example:

android:windowSoftInputMode="stateUnchanged|adjustPan"

Mode 3: Automatic mode The system automatically decides whether to use translation mode or compression mode. The deciding factor is whether the content can be scrolled.

android:windowSoftInputMode="adjustUspecified"

PS: Here is another online query tool for AndroidManifest.xml permission control:

I hope this article will be helpful to everyone’s Android programming design. .

For more articles related to the interface control method when the Android soft keyboard pops up, please pay attention to the PHP Chinese website!


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn