Die WebView-Größe wird erweitert, aber nicht gemäß dem darin enthaltenen Text verkleinert

Ich verwende WebView, um analysierte XML- und HTML-Inhalte anzuzeigen. Ich habe die layout_height von webview auf wrap_content gesetzt. Es funktioniert gut, wenn die Materie groß ist, aber wenn die Materie klein ist, wird sie nicht umwickelt, der untere Raum bleibt weiß. pls erklären mir, wie man es jedes Mal einwickelt, wenn ich Inhalt in webView ändere.

<?xml version="1.0" encoding="utf-8"?>
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background = "#ffffff"
>

<LinearLayout  android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:background = "#ffffff" >

 <WebView android:layout_height = "wrap_content"
  android:layout_width = "wrap_content" 
  android:id = "@+id/webcontent"    
   />  

<LinearLayout android:layout_width = "fill_parent"
 android:layout_height = "wrap_content"
 android:orientation = "horizontal"
 android:id = "@+id/buttons"
 android:background="#ffffff">
 <Button android:layout_height = "wrap_content"
     android:layout_width = "0dp" 
     android:id = "@+id/previousdata"         
     android:text = "Back"
     android:layout_weight = "1"
      android:layout_gravity="center_vertical"/>
   <Button android:layout_height = "wrap_content"
     android:layout_width = "0dp" 
     android:id = "@+id/nextdata"
     android:layout_weight = "1"
     android:text = "Next"
     android:layout_gravity="center_vertical"/>
  </LinearLayout>
</LinearLayout> 
 </ScrollView>

Jetzt bekomme ich das Problem, dass der WebView beim Ausführen meiner App im Hochformat zusätzlichen Leerraum erzeugt und sich nicht entsprechend den Daten verkleinert. Wenn ich jedoch die Ausrichtung ändere, um den Leerraum im Querformat darzustellen, verringert sich ... Bitte erläutern Sie, was passiert aus meiner sicht und wie kann ich den extra weissen raum verkleinern ... danke im vorraus ...

Antworten auf die Frage(1)

Ihre Antwort auf die Frage