Phonegap android: keyboard overlap input field

I have an input field in a web view, when you click on the keyboard input is shown, but it appears in the input field. I tried putting windowSoftInputMode="adjustPan" in androidManifest, but still the same. When you open the same html page in the device browser, everything is fine. Any ideas?

Hi

UPDATE:

It does not have an XML layout, because I use the Phonegap framework, and Activity extends DroidGap and does not have a setContentView(xx.xml) method.

 public class TestActivity extends DroidGap { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_RESIZE); setIntegerProperty("loadUrlTimeoutValue", 30000); super.loadUrl("file:///android_asset/www/index.html"); } } 
+6
source share
4 answers

I seem to have the same problem and added

 android:windowSoftInputMode="adjustPan" 

to the AndroidManifest.xml file, just like you. This did not work, and finally someone pointed out the use

 android:windowSoftInputMode="adjustResize" 

instead of this. Now it works for me. adjustPan seems to make more sense and adjusts. Resize sounds wrong, but it does the job.

+4
source

The phone table has preferences for a specific device. See Configurations on this page: https://build.phonegap.com/docs/config-xml And the solution to change to config.xml:

 preference name="android-windowSoftInputMode" value="stateVisible|adjustResize" 
+1
source

Try changing the full screen settings to false

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

I tried and succeeded!

+1
source

He worked for me with the answers collected from above:

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

and

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

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


All Articles