私のレイアウトは、いくつかの TextView と他のコントロールと ExpandableListView を備えた ScrollView です。
私がやりたいのは、ExpandableListView を展開すると、その下にあるコントロールが下に移動し、折りたたむと、すべてのコントロールが上に移動し、消耗品のグループのみが表示されることです。
問題は、wrap_content
expandView の Height に使用する場合、展開しても何も表示されず、インジケーター (小さな矢印) だけが展開されていることを示し、明示的にいくつかの数値を使用する場合です。200 dp、expandView の最下位アイテムは表示されません。(2 つの Scrolling ウィジェットを一緒に使用するため)。
これが私の単純化されたレイアウトです。
<ScrollView
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:ignore="HardcodedText" >
<LinearLayout>
//some controls
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content" >
<ExpandableListView
android:id="@+id/lstDrugs"
android:layout_width="match_parent"
//HERE is the point that wrap_content only shows the groups header
android:layout_height=**"wrap_content"**
android:layout_alignParentLeft="true"
android:layout_alignParentTop="true"
android:divider="@drawable/dividergradient"
android:dividerHeight="2dp" >
</ExpandableListView>
<Button
android:id="@+id/btnAddDrug"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@id/lstDrugs"
android:text="Add" />
</RelativeLayout>
</LinearLayout>