簡體   English   中英

Android Froyo WebView不能垂直滾動

[英]Android Froyo WebView doesn't scroll vertically

我的應用程序中有一個WebView小部件,可顯示自定義HTML內容。 這是我的布局:

<?xml version="1.0" encoding="utf-8"?>    
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:id="@+id/main_article_view"
 >
<RelativeLayout
    android:layout_width="fill_parent"
    android:layout_height="56dp"
    android:background="@drawable/header_background">

<Button 
    android:id="@+id/article_next"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:background="@drawable/right_segment"
    android:layout_centerVertical="true"
    android:layout_alignParentRight="true"
    android:layout_marginRight="2dip"
/>

<Button 
    android:id="@+id/article_previous"
    android:layout_height="wrap_content"
    android:layout_width="wrap_content"
    android:background="@drawable/left_segment"
    android:layout_centerVertical="true"
    android:layout_alignBaseline="@id/article_next"
    android:layout_toLeftOf="@id/article_next"
/>



<ImageView 
    android:layout_width="wrap_content"
    android:id="@+id/article_nav_logo" 
    android:layout_height="wrap_content"
    android:background="@drawable/app_logo"
    android:layout_toLeftOf="@id/article_previous"
    android:layout_centerVertical="true"
    android:layout_marginRight="15dp"/>

</RelativeLayout>

<com.myapp.android.NavBar
    android:id="@+id/vertical_navbar"
    android:layout_width="fill_parent"
    android:layout_height="45dp"
/>


<WebView
        android:id="@+id/webkit"
        android:layout_width="fill_parent" 
        android:layout_height="fill_parent" 
/>


</LinearLayout>

代碼非常簡單-處理布局的類也實現了WebViewClient方法。 它將html數據加載到WebView中。

該應用程序在除Froyo之外的所有操作系統上均可正常運行。 在Froyo上,WebView不響應垂直滾動事件-盡管它可以水平滾動。

我有一個onFling事件監聽器-已被禁用,但仍然沒有運氣。 任何幫助/提示,​​我們將不勝感激。 謝謝。

當您問問題的時候...。我發現了問題,我不確定是否與WebView有關。 在我的html模板中,我有這個

<meta name = "viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

此設置將導致WebView在Froyo上凍結。 后來,我發現此Building網頁可支持不同的屏幕密度以及關於stackoverflow的問題 希望它可以幫助其他人。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM