如何在android屏幕(webview)上放置网页? [重复]

|                                                                                                                   这个问题已经在这里有了答案:                                                      
已邀请:
        您的问题不是很清楚,但是如果我猜您是说
webview
不会扩展到适合整个屏幕的位置?请发布您的代码以支持您的问题。 要使“ 0”扩展到整个屏幕,请在活动布局xml中添加“ 0”,并确保将“ 3”和“ 4”设置为fill_parent。这是一个简单的示例:
  <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>
瑞安     
        对我有用的唯一方法是这种方式:
webView = (WebView) findViewById(R.id.noticiasWebView);
webView.setInitialScale(1);
webView.getSettings().setJavaScriptEnabled(true);
webView.getSettings().setLoadWithOverviewMode(true);
webView.getSettings().setUseWideViewPort(true);
webView.setScrollBarStyle(WebView.SCROLLBARS_OUTSIDE_OVERLAY);
webView.setScrollbarFadingEnabled(false);
webView.loadUrl(\"http://www.resource.com.br/\");
由于公司使用的设备种类繁多,因此我正在使用Android 2.1。但是我使用每个信息中的一部分来解决我的问题。     
        我的解决方案是不同的。 我做了一个足够大的网页,然后将其放大。在webview设置中,我输入以下内容:
WebView webview = new WebView(this);
//webview.setInitialScale(100); No need for this one
WebSettings settings = webview.getSettings();
settings.setBuiltInZoomControls(false);
settings.setUseWideViewPort(true);
settings.setJavaScriptEnabled(true);
settings.setSupportMultipleWindows(true);
settings.setJavaScriptCanOpenWindowsAutomatically(true);
settings.setLoadsImagesAutomatically(true);
settings.setLightTouchEnabled(true);
settings.setDomStorageEnabled(true);
settings.setLoadWithOverviewMode(true);
确保导入以下内容:
import android.webkit.WebSettings.ZoomDensity;
    

要回复问题请先登录注册