繁体   English   中英

WebView上的键盘错误-显示键盘时,它会导致白色背景

[英]Error with the keyboard on a WebView - when the keyboard is shown, it causes a white background

当我向我的应用显示评论Facebook时,结果如下。 但是,当我单击以提交评论时,设置键盘android:windowSoftInputMode =“ adjustPan”时,webview显示背景白色。 有时是滚动Webview底部时的原因。

当我没有点击时这是正常的

在此处输入图片说明

当键盘可见时,我必须找到带有底部视图的滚动父视图的解决方案。

  KeyboardVisibilityEvent.setEventListener(
                getActivity(),
                new KeyboardVisibilityEventListener() {
                    @Override
                    public void onVisibilityChanged(boolean isOpen) {
                        // some code depending on keyboard  status
                        if ((isOpen) &&(getUserVisibleHint())) {
                            if (nestVPageDetail != null) {
                                nestVPageDetail.post(new Runnable() {
                                    @Override
                                    public void run() {
                                        if ((nestVPageDetail != null) && (rvContentArrayDetail != null)) {
                                            nestVPageDetail.scrollTo(0,
                                                                     rvContentArrayDetail.getBottom());
                                        }
                                    }
                                });

                            }
                        }

                    }
                });

这是lib检查键盘:

 implementation 'net.yslibrary.keyboardvisibilityevent:keyboardvisibilityevent:2.1.0' 

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM