Hello,
today i want to show you how you can change Keyboard behaviors for your whole App.
In Example how you prevent your Android Keyboard from pushing up your Content or buttons over your Keyboard and so on.
It is really simple!
Just go to your Project and if you havent already add android platform to your project with:
ionic platform add android
after that to be on the safe side do the following
ionic build android
So now go into your Project and go to:
platforms -> android -> AndroidManifest.xml
In that file search for:
android:windowSoftInputMode="adjustResize"
and change it to:
android:windowSoftInputMode="adjustPan"
With this Setting your Keyboard overlaps all and does not Scroll up or down or move Divs or Inputs and so on.
Here are some other settings:
adjustNothing
Ignores the whole Layout. If it gets opened it must be closed by the user.
stateUnspecified
The state of the soft keyboard (whether it is hidden or visible) is not specified. The system will choose an appropriate state or rely on the setting in the theme. This is the default setting for the behavior of the soft keyboard.
stateUnchanged
The soft keyboard is kept in whatever state it was last in, whether visible or hidden, when the activity comes to the fore.
stateHidden
The soft keyboard is hidden when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
stateAlwaysHidden The soft keyboard is always hidden when the activity’s main window has input focus.
stateVisible
The soft keyboard is visible when that’s normally appropriate (when the user is navigating forward to the activity’s main window).
stateAlwaysVisible
The soft keyboard is made visible when the user chooses the activity — that is, when the user affirmatively navigates forward to the activity, rather than backs into it because of leaving another activity.
adjustUnspecified
It is unspecified whether the activity’s main window resizes to make room for the soft keyboard, or whether the contents of the window pan to make the current focus visible on-screen. The system will automatically select one of these modes depending on whether the content of the window has any layout views that can scroll their contents. If there is such a view, the window will be resized, on the assumption that scrolling can make all of the window’s contents visible within a smaller area. This is the default setting for the behavior of the main window.
adjustResize
The activity’s main window is always resized to make room for the soft keyboard on screen.
adjustPan
The activity’s main window is not resized to make room for the soft keyboard. Rather, the contents of the window are automatically panned so that the current focus is never obscured by the keyboard and users can always see what they are typing. This is generally less desirable than resizing, because the user may need to close the soft keyboard to get at and interact with obscured parts of the window.
All this information can be found here:
Desenvolvedores Android | Android Developers
Cheers