可能是因为 ExpandableListView 的子项高度没有设置为 'wrap_content',导致子菜单显示不全。可以尝试在 ExpandableListView 的子项布局中设置 android:layout_height="wrap_content",或者在代码中动态设置子项布局的高度为 'wrap_content'。

<?xml version='1.0' encoding='utf-8'?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:id="@+id/pullRefresh"
    android:layout_height="match_parent"
    android:fitsSystemWindows="true"
    android:orientation="vertical">

    <com.google.android.material.tabs.TabLayout
        android:id="@+id/tab_title"
        android:layout_width="match_parent"
        android:layout_height="12dp"
        android:layout_alignParentTop="true"
        android:layout_gravity="top|center_horizontal"
        app:tabMode="fixed"
        />
    <ExpandableListView
        android:id="@+id/zyzlistview"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginBottom="30dp"
        android:layout_alignParentTop="true"
        />

</LinearLayout>

原文地址: https://www.cveoy.top/t/topic/nYnc 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录