views:

179

answers:

1

hi
Is there any way to prevent android webview to scale the rendered web page .
I need to load an url which has links to other pages .When user clicks these links the rendered page is not aligned properly(i mean it cramps all the stuff within the screen width and height ) as compared to default handling of same web page by android browser .


The alignment is proper when i comment shouldOverrideUrlLoading ,but i need the redirects within my app so i can't avoid overriding shouldOverrideUrlLoading.Is there any other options left out.

android webview

The first image shows webview rendering page within my app as i override shouldOverrideUrlLoading and the second image shows the same screen after commenting shouldOverrideUrlLoading.

A: 

If you need some scaling, this for instance will scale the page to 50% of its original size in the webview :

wv.getSettings().setSupportZoom(true);
wv.getSettings().setUseWideViewPort(true);
wv.setInitialScale(50);
Sephy
thanks sephy ,but setInitialScale has no effect .i am still wondering about the reason.I see no problem with css hence it loads perfectly in Android browser.
ganesh