gpt4 book ai didi

android - 没有长触摸,WebView 不会在某些设备上滚动

转载 作者:行者123 更新时间:2023-11-29 13:58:40 25 4
gpt4 key购买 nike

我有一个 WebView 设置如下:

    //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();

在某些手机上,当 View 加载后,它可以很好地滚动,但在我的设备(运行 4.0.3 的 Sensation Xe)上, View 不会滚动。如果我长按 View ,它会选择一些文本,然后将正常滚动。这很烦人,因为对最终用户来说这样做并不明显。我已经尝试了上面概述的一些事情,有什么建议吗?

谢谢。

最佳答案

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

_mWebView.setVerticalScrollBarEnabled(true);

关于android - 没有长触摸,WebView 不会在某些设备上滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10736438/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com