Phonegap Keyboard Cover Input Field

I am very new to Android app development and I ran into a keyboard problem covering my input fields and I did a search and found out what I needed to add

Android: configChanges = "Screen size | locale"

to the xml file. However, I do not have AndroidManifest.xml in my directory. All I have is config.xml, which provided me with a phone call.

Then I found this https://github.com/phonegap/build/issues/160 , but I have no idea where to put this

Android: windowSoftInputMode = "value1 | value2 | valueN"

in my config.xml?

Any help is appreciated Thanks in adavance

+4
source share
7 answers

Tried the accepted answer from @markj, but that didn't work for me. What the DID job was adding this to my config.xml:

<preference name="fullscreen" value="false" /> 

You get a β€œstatus bar” on top of your application, but everything is fine with me ... Hope that helps

+8
source

Why not just use the PhoneGap Build site and upload a zip file? And forget about the manifest file that Amit talks about. I think it just makes everything more confusing. You need to understand the difference between the local development design and the online build of PhoneGap. If you just want to test your application, you do not need to have a local development environment. You can pin your www folder and upload it to PhoneGap Build. There is no command line and no complicated setup. If you want to edit the soft keyboard settings, you can edit your config.xml file and paste the following:

 <preference name="android-windowSoftInputMode" value="stateVisible|adjustResize" /> 

... or any parameters you want for windowSoftInputMode.

The documentation is here:

https://build.phonegap.com/docs/config-xml#platform

http://developer.android.com/guide/topics/manifest/activity-element.html#wsoft

Good luck to you.

+3
source

I solved this problem using css media requests.

 @media (max-height: 600px) { .login-header i { display: none; } } 

The keyboard resizes the screen, and css is higher, therefore, hides the "input header" when the screen size falls below an arbitrary value (for example, 600 pixels). This allows you to enter hidden input.

+2
source

FROM

 <preference name="fullscreen" value="true" /> 

I needed to do the following two

a. Use https://github.com/madebycm/AndroidBug5497Workaround/blob/master/AndroidBug5497Workaround.java to make sure cordova / phonegap can see the window height change

b. Add the code below in js. This step is required depending on how the html is written.

 document.addEventListener('deviceready', onDeviceReady, false); function onDeviceReady () { document.addEventListener('hidekeyboard', onKeyboardHide, false); document.addEventListener('showkeyboard', onKeyboardShow, false); } function onKeyboardHide() { console.log('onKeyboardHide'); } function onKeyboardShow(e) { console.log('onKeyboardShow'); setTimeout(function() { e.target.activeElement.scrollIntoViewIfNeeded() }, 500) //needed timeout to wait for viewport to resize } 
+2
source

Only one solution that worked for my fullscreen application was to add an ionic-plugin-keyboard plugin to the Cordoba application

 cordova plugin add com.ionic.keyboard 

JS Code:

 // This event fires when the keyboard will hide window.addEventListener('native.keyboardshow', keyboardShowHandler); function keyboardShowHandler(e){ $("body").addClass("keyboardOn"); } // This event fires when the keyboard will show window.addEventListener('native.keyboardhide', keyboardHideHandler); function keyboardHideHandler(e){ $("body").removeClass("keyboardOn"); } 

After that, you can customize the view using CSS.

ref .: fooobar.com/questions/613301 / ...

+1
source

You have a manifest file in plaforms / android. Go ahead and add your own version.

phonegap run android will add the android assembly of your phonegap project to the platforms directory, read http://docs.phonegap.com/en/edge/guide_platforms_android_index.md.html#Android%20Platform%20Guide

0
source

Your AndroidMainFest Location: Project Name β†’ Platform β†’ android β†’ AndroidMainFest.xml Your APK Location: Project-> bin-> projectname.apk

set android: windowSoftInputMode = "stateVisible \ adjustResize".,>

0
source

Source: https://habr.com/ru/post/1501584/


All Articles