键盘重叠输入字段

键盘重叠输入字段

本文介绍了PhoneGap android:键盘重叠输入字段的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

点击输入键盘时,我在Web视图中有一个输入字段显示了,但它超出了输入字段.我尝试将windowSoftInputMode="adjustPan"放在androidManifest中,但是还是一样.在设备的浏览器中打开相同的html页面时,一切正常.有任何想法吗 ?

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

致谢

更新:

它没有XML布局,因为我使用了Phonegap框架,并且Activity扩展了DroidGap,并且它没有setContentView(xx.xml)方法.

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

推荐答案

我似乎有完全相同的问题并添加了

I seem to have the exact same problem and added

android:windowSoftInputMode="adjustPan"

像您一样

到AndroidManifest.xml文件.这没有用,最后有人指出要使用

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

android:windowSoftInputMode="adjustResize"

相反.现在对我有用. AdjustPan似乎更有意义,adjustResize听起来不对,但确实可以.

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

这篇关于PhoneGap android:键盘重叠输入字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-16 04:31