我正在使用打开网站的 WebView,但它的滚动更多。它在浏览器中滚动较少,但在 webview 中滚动较多。我如何在 Web 视图中与浏览器相同。
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.activity_main);
final WebView myWebView = (WebView)findViewById(R.id.testwebview);
final ProgressBar myPB = (ProgressBar)findViewById(R.id.testprogressbar);
WebSettings webSettings = myWebView.getSettings();
webSettings.setSavePassword(false);
webSettings.setSaveFormData(false);
webSettings.setJavaScriptEnabled(true);
webSettings.setSupportZoom(false);
webSettings.setAppCacheEnabled(true);
// Add WebViewClient to be notified of page load
myWebView.setWebViewClient(new WebViewClient(){
@Override
public void onPageFinished(WebView view, String url){
// Show webview and hide progress bar
myWebView.setVisibility(View.VISIBLE);
myPB.setVisibility(View.INVISIBLE);
}
});
myWebView.loadUrl("http://pmtestonline.com");
}
}