WebView错误 - 没有正确调整

问题描述:

看来我的WebView总是完整的屏幕,并不尊重布局。WebView错误 - 没有正确调整

此外,活动菜单不是我设置的,但浏览器。

如果URL是www.google.com在手机模式或*.com 它似乎工作正常!?!

但是,一旦你点击经典模式或任何其他网站在移动/普通它占用整个屏幕。

它适用于loadData。

在此先感谢!

任何想法?

Michael

我正在测试一个2.1的android模拟器。

代码片段.........

setContentView(R.layout.mainactivity); 
WebView webV = (WebView)findViewById(R.id.webview); 
webV.setInitialScale(30); 
webV.loadUrl(getString(R.string.app_url)); 

布局....

<?xml version="1.0" encoding="utf-8"?> 

<RelativeLayout 
xmlns:android="http://schemas.android.com/apk/res/android" 
android:layout_width="fill_parent android:layout_height="fill_parent"> 

<TextView android:id="@+id/label" 
android:layout_width="fill_parent" 
android:layout_height="wrap_content" 
android:text="Type here:"/> 

<WebView xmlns:android="http://schemas.android.com/apk/res/android" 
android:id="@+id/webview" android:layout_width="wrap_content" 
android:layout_height="wrap_content" android:layout_below="@id/label" 
/> 

</RelativeLayout> 

这不是的WebView故障;在WebView内部单击链接时,默认行为是使用URL打开系统浏览器应用程序(请参阅WebView tutorial上的#6)。

这实际上是this SO question的副本;简单的答案是,您需要为WebView设置WebViewClient并设置shouldOverrideUrlLoading