0

Helo,

I have a problem with screen shrinking on Android devices if virtual keyboard is displayed.I would like to keep screen without shrinking.

I tried to use following setting in cordova config.xml file in the root of the project:

<preference name="Orientation" value="portrait"/>
  <preference name="KeyboardShrinksView" value="false" />
  <preference name="LoadingDialog" value="My Title,My Message"/>
  <preference name="DisallowOverscroll" value="false" />
  <preference name="fullscreen" value="false" />

But without the luck

Or set directly these attributes:

 android:windowSoftInputMode="adjustPan" 
 android:isScrollContainer="false"

Into AndroidManifest.xml file. But in this case are changes each time overwritten by running cordova build command.

How can i solve it please?

Thanks for any help.

See image below:

enter image description here

redrom
  • 11,502
  • 31
  • 157
  • 264
  • Might be a long shot but maybe try `setFitsSystemWindows(false)` on the root view? I had the opposite problem where the view would not scroll until I added `fitsSystemWindows="true"` – vkislicins Apr 08 '15 at 22:11
  • Perhaps setting a min-height on the body tag when the keyboard show even fires? `document.addEventListener("showkeyboard", function(){ //set min height on body;}, false);` Caveats: http://stackoverflow.com/questions/20081949/detecting-android-softkeyboard-show-hide-events – laughingpine Apr 08 '15 at 22:30

1 Answers1

0

change manifest entry.. it will stop screen shrinking.

android:windowSoftInputMode="adjustNothing"
Arnav M.
  • 2,590
  • 1
  • 27
  • 44
  • I cannot change manifest entry, is each time overwritten by running cordova build command. (I wrote it in question above). – redrom Apr 09 '15 at 06:47
  • You have to use a hook. https://github.com/djett41/generator-ionic/blob/master/templates/hooks/after_prepare/update_platform_config.js looks like it might do the trick. Create folder after_prepare in the hooks folder and copy that script. Next add `` to your config.xml under the android platform. – laughingpine Apr 09 '15 at 20:45