【发布时间】:2019-03-07 21:52:21
【问题描述】:
点击输入键盘时,我在 web 视图中有一个输入字段
显示,但它出现在输入字段上。
我尝试将windowSoftInputMode="adjustPan" 放入 androidManifest 但
还是一样。
在设备的浏览器中打开相同的 html 页面时,一切正常。
有任何想法吗 ?
问候
更新:
它没有 XML 布局,因为我使用 Phonegap 框架并且 Activity 扩展了 DroidGap,并且它没有 setContentView(xx.xml) 方法。
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");
}
}
【问题讨论】:
-
在这里尝试建议:stackoverflow.com/questions/6205697/… 如果它不起作用,请发布您的 XML 布局源。
-
@Jan Gerlinger 它没有 xml 布局。因为我使用 Phonegap 框架并且 Activity 扩展了 DroidGap。并且没有 setContentView(xx.xml) 方法。 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");