WebView 不会在没有长按的情况下在某些设备上滚动 [英] WebView will not scroll on some devices without long touch

查看:44
本文介绍了WebView 不会在没有长按的情况下在某些设备上滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 WebView 设置如下:

I have a WebView set up as below:

    //the web view
    _mWebView = (WebView) findViewById(R.id.webView);

    //push the url on to the web view
    _mWebView.loadUrl(buildURL.toString());

    //make the view transparent to get rid of white box while loading
    _mWebView.setBackgroundColor(0x00000000);

    //_mWebView.bringToFront();
    //_mWebView.requestFocus();
    //_mWebView.requestFocusFromTouch();

在某些手机上,当视图加载后它会滚动得很好,但在我的设备上,运行 4.0.3 的 Sensation Xe,视图不会滚动.如果我长时间触摸视图,它会选择一些文本,然后正常滚动.这很烦人,因为对最终用户这样做并不明显.我已经尝试了上面列出的一些方法,有什么建议吗?

On some phones when the view has loaded it will scroll fine but on my device, Sensation Xe running 4.0.3, the view does not scroll. If I do a long touch on the view it selects some text and will then scroll normally. This is annoying as it will not be obvious to do this to the end user. I have tried a few things as outlined above, any suggestions?

谢谢.

推荐答案

在你的代码中加入这一行,可能会帮助你尝试一下,

add this line in your code, may be this help you try it,

_mWebView.setVerticalScrollBarEnabled(true);

这篇关于WebView 不会在没有长按的情况下在某些设备上滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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