是否有任何选项可以将元素放置在可扩展列表下方,让我解释一下:我已经在列表下方实现了元素,但它们的行为就像页脚 - float 在屏幕底部。
但是,如果我将元素放置在 xml 中的列表下方,则当展开任何组时,元素将被隐藏。
目前我的布局是这样的
http://shrani.si/f/2s/ba/ga2VKfi/lay2.jpg
但我想在列表的末尾像这样
http://shrani.si/f/42/4m/2GAcNu6T/lay3.jpg
我现在的布局
<LinearLayout
android:id="@+id/linearLayoutListExer"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginTop="10dip"
android:background="#ffffff"
android:gravity="center_vertical"
android:orientation="vertical">
<ExpandableListView
android:id="@+id/ExerciseELV"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/linearLayoutStatus"
android:layout_weight="1"
android:groupIndicator="@null" />
<LinearLayout
android:id="@+id/relativeFooter"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/linearLayoutListExer"
android:background="#ffffff"
android:orientation="vertical">
<TextView
android:id="@+id/textViewBellowExercise"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:padding="10dip"
android:text="The following exercises will help you lose body weight"
android:textAppearance="?android:attr/textAppearanceSmall"
/>
<LinearLayout
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_below="@id/textViewBellowExercise">
<Button
android:id="@+id/buttonFaceit"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@color/green"
android:text="FaceIT!"
android:textColor="@color/white" />
<Button
android:id="@+id/buttonChallenge"
android:layout_width="0dp"
android:layout_height="20dp"
android:layout_margin="5dp"
android:layout_weight="1"
android:background="@color/red"
android:text="Challenge"
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
最佳答案
您的以下属性应该更改。
代替
android:layout_below="@id/linearLayoutListExer"
你应该写
android:layout_below="@id/ExerciseELV"
对于带有 android:id="@+id/relativeFooter"
这将使底部布局出现在 ListView 下方
关于java - 可展开列表下方的元素 - 非 float 页脚,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22804595/