Wednesday, 15 April 2015

Webview content coming small in 5+ android versions as compared to lower versions

Issue Faced when changing target version from 17 to 21

hi guys today i was working on a issue which was : Content (i.e images,text etc loaded from a url) inside the webview was coming small and Same content was coming of bigger size in Lower versions (Android Version <= 4.4).As there are some changes made in the latest webview this was the reason.

I added following properties to my webview and My Problem was solved.

wvWebView.setInitialScale(1);

wvWebView.getSettings().setLoadWithOverviewMode(true);

wvWebView.getSettings().setUseWideViewPort(true);




Before






After










hope this help others as well.

Happy coding!!
Cheers!!

No comments:

Post a Comment