Is there anyway I can fix a webview?
Posted
by Legend
on Stack Overflow
See other posts from Stack Overflow
or by Legend
Published on 2010-05-25T02:21:22Z
Indexed on
2010/05/25
2:31 UTC
Read the original article
Hit count: 412
I am trying to load a webpage into a sample webview that I created:
public class HelloWebview extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
WebView webview;
webview = (WebView) findViewById(R.id.webview);
webview.getSettings().setDefaultZoom(ZoomDensity.FAR);
webview.setHorizontalScrollBarEnabled(false);
webview.setVerticalScrollBarEnabled(false);
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("http://10.0.2.2/index.html");
}
}
Initially, I had a problem with the scrollbars so I added the two lines to disable them. Now, I am still able to pan around the webpage though the scroll bars are not visible. How can I fix the view so that I am not able to pan (or scroll) the webpage? By panning, I mean moving around the webpage with an onTouch event.
© Stack Overflow or respective owner