2010-06-21 5 views
2

J'ai un widget WebView dans mon application qui affiche du contenu HTML personnalisé. Ceci est ma mise en page:Android Froyo WebView ne défile pas verticalement

<?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> 

Le code est très simple - la classe qui gère la mise en page met également en œuvre les méthodes de WebViewClient. Il charge les données html dans le WebView.

L'application fonctionne bien sur tous les systèmes d'exploitation sauf Froyo. Sur Froyo, le WebView ne répond pas à l'événement de défilement vertical - il peut cependant défiler horizontalement.

J'avais un écouteur d'événement onFling - qui a été désactivé, mais toujours pas de chance. Toute aide/indice est grandement appréciée. Merci.

Répondre

1

Au moment où vous posez la question .... J'ai trouvé le problème et je ne sais pas si elle est liée à WebView. Dans mon modèle html j'ai ceci

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

Ce paramètre entraînera le gel de WebView sur Froyo. Plus tard j'ai trouvé ceci Building web pages to support different screen densities et ceci question on stackoverflow. J'espère que cela aidera quelqu'un d'autre sur la ligne.