1
如果我的WebView太大,我沒問題,即使內容太大,WebView高度也適合屏幕高度,我可以滾動WebView的內容。 但是,如果WebView的內容很少,則WebView高度不適合屏幕。如何使WebView高度尺寸與屏幕高度吻合?
這是我的佈局:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="wrap_content" >
<ScrollView android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true">
<WebView android:id="@+id/webview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fitsSystemWindows="true" />
</ScrollView>
<LinearLayout android:id="@+id/media_player"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:visibility="visible">
<Button android:textStyle="bold"
android:id="@+id/ButtonPlayStop"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@android:drawable/ic_media_play" />
<SeekBar android:id="@+id/SeekBar"
android:layout_height="wrap_content"
android:layout_width="fill_parent"
android:layout_below="@id/ButtonPlayStop" />
</LinearLayout>
下面是截圖:
任何一個可以幫助我解決這個問題?
你的答案是非常大的。謝謝你的幫助。我瞭解到我需要更多地使用RealativeLayout http://developer.android.com/reference/android/widget/RelativeLayout.LayoutParams.html –