gpt4 book ai didi

android - 抽屉导航内的可扩展 ListView 未到达系统栏底部

转载 作者:太空狗 更新时间:2023-10-29 14:17:10 26 4
gpt4 key购买 nike

我正在尝试在抽屉导航内实现“可扩展 ListView ”,如下图所示。有4组,每组有很多 child 。我的问题是,可扩展 ListView 的高度“”。我怎样才能使这个高度达到系统栏的底部,就像使用带有 4 组数据的 ListView 的普通抽屉导航一样?

expandable listview

这是我的 main_activity.xml :

<android.support.v4.widget.DrawerLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="fill_parent"
android:layout_height="fill_parent">

<FrameLayout
android:id="@+id/content_frame"
android:layout_width="match_parent"
android:layout_height="match_parent" >
</FrameLayout>

<ExpandableListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/black"
android:dividerHeight="1dp"
android:indicatorRight="430dp"/>

</android.support.v4.widget.DrawerLayout>

如有任何帮助,我们将不胜感激。环境:Windows 7、ADT、Genymotion。

最佳答案

同时将背景颜色设置为 ExpandableListView

<ExpandableListView
android:id="@+id/left_drawer"
android:layout_width="240dp"
android:layout_height="match_parent"
android:layout_gravity="start"
android:choiceMode="singleChoice"
android:divider="@android:color/black"
android:dividerHeight="1dp"
android:indicatorRight="430dp"
android:background="#fff"/>

我认为您的可扩展列表是 match_parent,但它没有背景,只有 4 个项目。

关于android - 抽屉导航内的可扩展 ListView 未到达系统栏底部,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20898648/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com