as you can see from the code below all im trying todo is load a
webpage then have it auto scroll to a part of that page. u can see in
the first button i've tried just calling scrollTo directly on the
webview but that doesnt work. as well as implementing a subclass that
extends the webviewclient.
whats weird i guess is that the subclass thing kind of works. but on
first go the page loads normal then when i click the opposite button
it scrolls(which seems only horizontal)
i really just need the webview to scroll down(vertical) a little bit
------------------
Button Button = (Button) findViewById(R.id.button);
Button.setOnClickListener(new View.OnClickListener() {
public void onClick(View v) {
webView = (WebView) findViewById(R.id.webview);
webView.getSettings().setJavaScriptEnabled(true);
webView
.loadUrl("http://252Fblog.us.pln.com%252F");
webView.scrollTo(30, 30);
}
});
-----------------------------------tried these as well
private class HelloWebViewClient extends WebViewClient {
@Override
public void onPageFinished(WebView view, String url){
view.scrollTo(50, 0);
}
}
-------------------------------
private class HelloWebViewClient extends WebViewClient {
@Override
public void onLoadResource(WebView view, String url){
view.scrollTo(300, 0);
}
@Override
public void onPageFinished(WebView view, String url){
view.scrollTo(300, 0);
}
public void doUpdateVisitedHistory (WebView view, String url,
boolean isReload){
view.scrollTo(300, 0);
}
}
}
--------------------------------------
@Override
protected void onLayout(boolean changed, int l, int t, int r, int
b) {
super.onLayout(changed, l, t, r, b);
if(changed)
scrollTo(90, 0);
}
--
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