开发者

Whole HTML page does not show up in a WebView

I have an HTML page opened in a WebView in my Android app. But that page is not auto-sized to fit in the WebView, hence some part of the page does not show up there in the WebView. I want that, when an HTML page is opened in a WebView, the whole page must fit in the WebView. I have gone through other related questions and I have tried them, but it did not work for me.

I have added these lines to WebView:

    webView.getSettings().setUseWideViewPort(true);
    webView.getSettings().setLoadWithOverviewMode(true); 

but nothing happened, is there any other way of implementing this thing? Help is always appreciat开发者_C百科ed.


This works with me:

WebView myWebView = (WebView) findViewById(R.id.webView1);

myWebView.getSettings().setLoadWithOverviewMode(true);

myWebView.getSettings().setUseWideViewPort(true);

myWebView.loadUrl("http://saudi-arabia.gold-price-today.com/");

If this code doesn't work for you, try to use it in new project.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜