Android的窗口不会调整/出锅时softinput从web视图打开 [英] Android window doesn't resize/pan when softinput opened from WebView

查看:117
本文介绍了Android的窗口不会调整/出锅时softinput从web视图打开的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的问题是下面的。

  1. 在应用程序使用的主题安卓Theme.NoTitleBar.Fullscreen 键,只有一个活动,其他所有意见片段
  2. 的WebView ViewPager片段这里面滚动型
  3. 在HTML内容输入字段
  4. 在我点击输入字段这是对的WebView
  5. 的底部
  6. 在软输入打开,但窗口未调整/摇摄
  1. Application uses theme android:Theme.NoTitleBar.Fullscreen and there is only one Activity, all other views are Fragment
  2. I have WebView inside ViewPager Fragment which is inside ScrollView
  3. HTML content has input fields
  4. I click input field which is on bottom of WebView
  5. Soft input opens, but the Window is not resized/panned

我试过设置安卓windowSoftInputMode =adjustResize安卓windowSoftInputMode =adjustPan的我的清单为活动。也试过设置那些在java中的一个。

I've tried setting android:windowSoftInputMode="adjustResize" or android:windowSoftInputMode="adjustPan" in my manifest for the Activity. Also tried setting one of those in java.

正常的EditText 滚动型在我的应用程序调整盘正常使用,这时用户可以看到他/她是打字。

Normal EditText inside a ScrollView in my application does adjust pan properly so user can see where he/she is typing.

感谢。

更新:

如果没有可行的解决方案来获得窗口调整,有没有办法让的WebView 认为它的内容就像是半个屏幕的高度更多更大,所以用户至少可以滚动输入可见。

If there is no working solution to get window adjust, is there a way to get WebView think it's content is like half screen height more bigger so user could at least scroll the input visible.

推荐答案

好了,这已经从一开始的问题,谷歌还没有固定它,但也许永远不会。但是从这个问题:的http:// code ?.google.com / P /安卓/问题/细节ID = 5497 我发现潜在的解决方法是:<一href="http://stackoverflow.com/a/19494006/1241783">http://stackoverflow.com/a/19494006/1241783

Okay so this has been an issue from the very beginning and Google hasn't fixed it yet, maybe never. But from the the issue: http://code.google.com/p/android/issues/detail?id=5497 I found potential workaround for this: http://stackoverflow.com/a/19494006/1241783

我已经覆盖的WebView ,我只是增加了$ C $下它和它运作良好足以让调整窗口。这是可能的,虽然在code并不总是因为各种屏幕高度的工作,可能需要一些调整,但在许多情况下,它的工作好和我一起去的,因为它是唯一的工作解决方案,我都看到了。

I have overridden WebView and I simply added the code for it and it is working well enough to get the window adjusted. It is possible though the code doesn't always work because of various screen heights and might need some adjustments, but in many cases it is working okay and I go with that, since it's the only working solution I have seen.

这篇关于Android的窗口不会调整/出锅时softinput从web视图打开的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆