0

I'm devloping an apk to display some web pages by using webview. The web pages have two size: 640*530

<meta name="page-view-size" content="640*530" />

it's diaplayed like this

1280*720

<meta name="page-view-size" content="1280*720" />

it's now displayed full screen

How can i display all size pages in fullscreen with one webview?

The device is version is Android 4.4.2

I've tried these methods:

WebSettings webSettings = mWebView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setPluginState(PluginState.ON);
webSettings.setSupportZoom(true);
webSettings.setLoadWithOverviewMode(true);
webSettings.setUseWideViewPort(true);

neither one is work for me.

Thanks.

leeooo
  • 9

1 Answers1

0

you can try this for your web page header:

<meta id="viewport" name="viewport" width="initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
GiapLee
  • 436
  • 2
  • 8
  • thanks a lot.but the web page is online, and can not be modfied. – leeooo Mar 14 '16 at 09:51
  • oh. so you can read for solution from here http://stackoverflow.com/questions/3916330/android-webview-webpage-should-fit-the-device-screen – GiapLee Mar 14 '16 at 09:58
  • thanks a lot for your reply, all the methods i listed above were from the same solution you mentioned. – leeooo Mar 14 '16 at 14:31
  • I think is really deficult if you are not website owner because screen fit depend on website header... also unless you get lucky in sometimes load website – GiapLee Mar 14 '16 at 14:38