我想嵌入一個webview在一個framelayout。我的launch.xml如下所示。Webview +滾動問題+ android
<FrameLayout 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"/>
</FrameLayout>
我已經實現了WebChromeClient
和WidgetViewClient
。我實施了onTouchEvent
並將觸摸事件傳遞給WebView
。
我面臨的問題是我無法在webview中滾動。例如,內容是5行,然後只能看到3行,無法滾動。
觸摸事件去Webview
,第一個action_down
然後action_move
,我不能得到什麼錯誤嗎?
我有這樣的代碼也
mWebView.setHorizontalScrollBarEnabled(true);
mWebView.setVerticalScrollBarEnabled(true);
還有什麼我必須設置?
我已經預先用血肌酐更換的FrameLayout 感謝檢查..
你好,,我已經檢查了網頁視圖的教程。我刪除了FrameLayout,但無論如何沒有幫助..我已經做了完全相同的教程,但它不工作.. mWebView.loadUrl(url);在這個如果我給網址作爲一些「http://www.google.com」它工作得很好,但當url是「file://mnt/sdcard/abc.html」(我得到解壓縮一些包)它不起作用。這個問題在過去的10天裏讓我感到困惑。如果我保存從瀏覽器保存的一些頁面,然後嘗試加載它,如上所述它再次工作.. – 2011-02-11 12:29:19