0
我想顯示網址欄和網頁(在URL欄下方)。但我不知道爲什麼它只顯示網頁。爲什麼WebView中不顯示地址欄?
XML代碼:
<EditText
android:id="@+id/etURL"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:inputType="text"
/>
<WebView
android:id="@+id/webview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_alignParentBottom="true"
android:layout_below="@+id/etURL"
/>
Java代碼:
webView = (WebView) findViewById(R.id.webview);
WebSettings ws = webView.getSettings();
ws.setJavaScriptEnabled(true);
ws.setSupportMultipleWindows(true);
ws.setSupportZoom(true);
ws.setBuiltInZoomControls(true);
ws.setCacheMode(WebSettings.LOAD_NO_CACHE);
ws.setUseWideViewPort(true);
ws.setLoadWithOverviewMode(true);
ws.setLoadsImagesAutomatically(true);
webView.setScrollBarStyle(View.SCROLLBARS_INSIDE_OVERLAY);
webView.loadUrl(mURL);
MyWebViewClient wvc = new MyWebViewClient();
webView.setWebViewClient(wvc);
wvc.setActivity(this);
wvc.setListener(this);
我想,地址欄是由網頁覆蓋。如何在地址欄下方顯示網頁?
如果我記得正確的是webclient相關的東西。嘗試運行相同的沒有'webView.setWebViewClient(wvc);' – Blackbelt 2014-10-07 12:51:42
刪除完整的'wvc'部分。但它沒有運行@blackbelt – SGG 2014-10-07 12:58:58
*沒有運行什麼*意思是 – Blackbelt 2014-10-07 12:59:37