Hi,
I'm loading a URL into a WebView and I'm having difficulty setting the
"scale" of the web-page.
Specifically, the web-page is too big (800x600) for the screen, so my
thought is to use "setInitialScale(50)" to reduce the size
xxxxxxxxxx ATTEMPT # 1 xxxxxxxxxxxxxxxxxxxxx
Here is some sample code that doesn't work (i.e. the web-page doesn't
scale to 50%)
WebView wv = (WebView)findViewById(R.id.webview);
wv.loadUrl("http://www.example.com/android/symptom");
wv.setInitialScale(50);
I also tried switching the order of the function calls but I get the
same result…i.e.,
WebView wv = (WebView)findViewById(R.id.webview);
wv.setInitialScale(50);
wv.loadUrl("http://www.example.com/android/symptom");
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxx ATTEMPT # 2 xxxxxxxxxxxxxxxxxxxxxxxxx
As an alternative, I have tried to use the "zoomOut()" function like
this:
WebView wv = (WebView)findViewById(R.id.webview);
wv.loadUrl("http://www.example.com/android/symptom");
wv.zoomOut();
This approach works for a split second, and then the image reverts to
its original size.
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Any idea as to what I'm doing wrong?
here is my content view
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent" />
</LinearLayout>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en