WebView wrap-content

前端 未结 10 2398
我寻月下人不归
我寻月下人不归 2020-12-13 02:26

Is it possible to load a URL in a WebView and resize it to fit the screen? I mean I want to make the WebPage small so that the user doesn\'t need to scroll. Is this possible

相关标签:
10条回答
  • 2020-12-13 03:04
    webview.setInitialScale(number);
    

    where the higher 'number' is, the more zoomed in your page will be. start with lower numbers ( like 10) and adjust to taste

    0 讨论(0)
  • 2020-12-13 03:05

    You can also try setting an layout algorithm for the same.It worked for me

    webview.getSettings().setLayoutAlgorithm(LayoutAlgorithm.SINGLE_COLUMN);
    
    0 讨论(0)
  • 2020-12-13 03:05

    Use this code for resize your webview according to screen .

    setScrollContainer(false);

    0 讨论(0)
  • 2020-12-13 03:09

    Have you tried just calling WebView.zoomOut() repeatedly until it returns false?

    Also, I would note that this technique you want to use really relies on the web page being quite short. If the page is long and you zoom out to fit it entirely on screen, the user is going to need very good eye sight! ;)

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