6

I've an input field in a webview, when clicking on input the keyboard is shown but it comes over the input field. I tried putting windowSoftInputMode="adjustPan" in androidManifest but still the same. When opening the same html page in device's browser everything is ok. Any ideas ?

Regards

UPDATE:

It doesn't have an XML layout, because I use the Phonegap framwork and the Activity extends DroidGap, and it doesn't 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");
    }
}
Jan Gerlinger
  • 7,361
  • 1
  • 44
  • 52
vanshu
  • 537
  • 1
  • 7
  • 17
  • Try the suggestions here: http://stackoverflow.com/questions/6205697/soft-keyboard-comes-over-the-edittext If it doesn't work please post your XML Layout source. – Jan Gerlinger Jul 14 '12 at 10:44
  • @Jan Gerlinger it didn't have xml layout.because I use the Phonegap framwork and the Activity extends DroidGap. and dont not have setContentView(xx.xml) method. 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"); – vanshu Jul 16 '12 at 03:24

5 Answers5

6

I seem to have the exact same problem and added

android:windowSoftInputMode="adjustPan"

to the AndroidManifest.xml file as you did. This did not work and finally somebody pointed out to use

android:windowSoftInputMode="adjustResize"

instead. This works for me now. adjustPan seems to make more sense and adjustResize sounds wrong, but it does the job.

mackrauss
  • 96
  • 1
  • 3
1

In phonegap there are preferences for specific device. See configurations on this page: https://build.phonegap.com/docs/config-xml And the solution to change on config.xml is:

preference name="android-windowSoftInputMode" value="stateVisible|adjustResize"
fjsj
  • 10,995
  • 11
  • 41
  • 57
1

Try to change preferences fullscreen to false

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

I tried and success!

Johnny
  • 414
  • 3
  • 12
1

It worked for me with the answers combined from above:

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

and:

<preference name="fullscreen" value="false"/>
Mihaita Tinta
  • 219
  • 2
  • 6
0

Hi you can do it using with js and css codes. Thats working for me.

JS:

$("form input,textarea,select").focusin(function (){

    $(".scrollablefield").animate({
        scrollTop: $(this).offset().top
    }, 600);
  });

css:

form{
    padding-bottom: 300px;
}
Ferhat KOÇER
  • 3,890
  • 1
  • 26
  • 26