0
我有一个webview和一个包含4个按钮的表。我已将webview的高度设置为400px,以便按钮以纵向模式显示在屏幕的底部。我的问题是,当更改为横向模式时,按钮不可见。所以当我改变方向时,我需要在运行时改变webview的高度。有谁知道如何做到这一点?我可以使用'onConfigurationChanged'函数捕获方向更改。如何更改运行时的webview的高度?
感谢CommonsWare,我给了XML如下。应用程序在启动时崩溃。
<LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<RelativeLayout android:layout_alignParentTop="true">
<WebView
android:id="@+id/appView"
android:layout_height="wrap_content"
android:layout_width="fill_parent" />
</RelativeLayout>
<RelativeLayout
android:layout_alignParentBottom="true">
<TableLayout
android:id="@+id/TableLayout01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical">
<TableRow
android:id="@+id/TableRow01"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:gravity="center">
<ImageButton
android:id="@+id/more"
android:padding="1dip"
android:src="@drawable/more1"
android:layout_marginRight="15dip">
</ImageButton>
<ImageButton
android:id="@+id/albums"
android:padding="1dip"
android:src="@drawable/albums1"
android:layout_marginRight="15dip">
</ImageButton>
<ImageButton
android:id="@+id/videos"
android:padding="1dip"
android:src="@drawable/videos"
android:layout_marginRight="15dip">
</ImageButton>
<ImageButton
android:id="@+id/artists"
android:padding="1dip"
android:src="@drawable/artists1"
android:layout_marginRight="15dip">
</ImageButton>
</TableRow>
</TableLayout>
</RelativeLayout>
</LinearLayout>