PhoneGap android : keyboard overlaps input field

Viewed 7228

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");
    }
}
5 Answers

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;
}
Related