Enable horizontal scrolling in a webview

前端 未结 1 935
南笙
南笙 2021-01-04 02:23

In my webview activity, I can scroll the webpage vertically (up and down) but i can\'t scroll it horizontally (from right to left or from left to right), when I zoom the web

1条回答
  •  一生所求
    2021-01-04 02:34

    Short answer:

    Use this

    mWebView.getSettings().setUseWideViewPort(true);
    

    Long Answer:

    It might be due to any of the below factors

    setLoadWithOverviewMode(true) loads the WebView completely zoomed out

    setUseWideViewPort(true) makes the Webview have a normal viewport (such as a normal desktop browser), while when false the webview will have a viewport constrained to it's own dimensions (so if the webview is 50px*50px the viewport will be the same size)

    OR

    Webview.setInitialScale(xx);
    

    0 讨论(0)
提交回复
热议问题