小编Per*_*rry的帖子

如何在Android中停止WebView的INTERNAL滚动?

我的应用程序中有一个WebView,其中包含HTML内容,HTML内容的大小大于WebView的大小.当用户将他/她的手指拖到其上时,由于哪些内容在其内部滚动.我想停止内容滚动发生内容.

这是迄今为止我已经尝试过的内容:

WebView view = new WebView(context);  //context is of Activity
view.setHorizontalScrollBarEnabled(false);
view.setVerticalScrollBarEnabled(false);
view.setScrollContainer(false);
Run Code Online (Sandbox Code Playgroud)

在CSS中:

overflow : hidden !important;
Run Code Online (Sandbox Code Playgroud)

请建议除了禁用手指拖动(黑客)以进行webview 之外的解决方案,因为这会影响我的其他功能,如下所示:

@Override
public boolean onTouch(View view, MotionEvent motionEvent) {
    if(motionEvent.getAction() == MotionEvent.ACTION_MOVE)
    {
        return true;
    }
  }
Run Code Online (Sandbox Code Playgroud)

html css android scroll webview

9
推荐指数
1
解决办法
2785
查看次数

标签 统计

android ×1

css ×1

html ×1

scroll ×1

webview ×1