WebView Android n'est pas à défilement

Mon Android WebView n'est pas déplacé.

Code XML:

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/screen"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#87cefa"
android:gravity="left"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context=".MainActivity" >

<WebView
    android:id="@+id/webView"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_alignParentLeft="true"
    android:layout_centerHorizontal="true" />

Je suis le chargement du Site web avec la normale webview.loadUrl(url); fonction et parfois avec l' webview.loadDataWithBaseURL("", htmlContent, "text/html", "UTF-8", ""); fonction, à la fois de leur affichage de la page, mais ils ne sont pas à défilement

Init:

setContentView(R.layout.activity_main);
webview = (WebView)this.findViewById(R.id.webView);
webview.setVerticalScrollBarEnabled(true);
webview.setHorizontalScrollBarEnabled(true);

De chargement:

            webview.loadUrl(url);
            [either one of them or the other]
    webview.loadDataWithBaseURL("", htmlContent, "text/html", "UTF-8", "");
  • Peut-être ajouter le ScrollView pour être son parent?
  • Mettre webView dans un linéaire de la mise en page et définir l'orientation verticale, le Défilement sera activé.
  • double possible de Android WebView de Défilement
  • Aucun d'eux ne m'a aidé 🙁
InformationsquelleAutor Abascus | 2014-01-03