可能是子菜单的高度没有设置正确导致的显示不全问题。尝试在子菜单布局文件中设置合适的高度,例如:

<?xml version='1.0' encoding='utf-8'?>
<LinearLayout xmlns:android='http://schemas.android.com/apk/res/android'
    android:layout_width='match_parent'
    android:layout_height='40dp'
    android:orientation='horizontal'>

    <TextView
        android:id='@+id/child_item'
        android:layout_width='match_parent'
        android:layout_height='match_parent'
        android:layout_marginStart='20dp'
        android:gravity='center_vertical'
        android:textColor='@color/black'
        android:textSize='16sp' />

</LinearLayout>

其中,android:layout_height='40dp' 表示子菜单的高度为40dp,可以根据实际情况进行调整。

Android ExpandableListView 子菜单显示不全解决方案

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

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