我有一个布局大小的问题...
我有一个布局,其中包含一个ViewFlipper、一个LinearLayout(包含一个MapView)和第二个LinearLayout,全部垂直排列。
<LinearLayout
android:width="match_parent"
android:height="match_parent" >
<ViewFlipper
android:width="match_parent"
android:height="wrap_content" >
// Top elements
</ViewFlipper>
<LinearLayout
android:width="match_parent"
android:height="match_parent" >
// MapView
</LinearLayout>
<LinearLayout
android:width="match_parent"
android:height="wrap_content" >
// Bottom elements
</LinearLayout>
</LinearLayout>
我看到的问题是当我使用showNext()或showPrevious()更改ViewFlipper以显示较短的视图时,中间的LinearLayout没有扩展以填充空间。此外,当我切换到较短的视图时,我看到了剩余的黑色/空白空间。
有没有一种巧妙的方法动态调整这些元素的大小,使得MapView布局会扩展填满除ViewFlipper和底部的LinearLayout之外的所有空间?