Android 如何修复父级而非子级中可展开列表视图中的空间
我使用可扩展的列表视图。我想展示父母之间的空间,但孩子还是一样。 我使用可扩展列表视图Android 如何修复父级而非子级中可展开列表视图中的空间,android,listview,expandablelistview,Android,Listview,Expandablelistview,我使用可扩展的列表视图。我想展示父母之间的空间,但孩子还是一样。 我使用可扩展列表视图 <ExpandableListView android:id="@+id/listviewExpandAble" android:layout_width="0dp" android:layout_height="0dp" android:layout_marginBottom="8dp" android:layout_
<ExpandableListView
android:id="@+id/listviewExpandAble"
android:layout_width="0dp"
android:layout_height="0dp"
android:layout_marginBottom="8dp"
android:layout_marginLeft="8dp"
android:layout_marginRight="8dp"
android:layout_marginTop="8dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintLeft_toLeftOf="parent"
app:layout_constraintRight_toRightOf="parent"
android:dividerHeight="10dp"
app:layout_constraintTop_toTopOf="parent"></ExpandableListView>
请尝试以下代码:-
请尝试以下代码:-
你能告诉我它将如何工作吗。我是一名新开发人员PLZ为什么我们在childdivided中使用颜色在XML中使用此代码,并在样式内的颜色文件中定义常量“child\u divider\u color”这只是可选的,如果您不想使用,请忽略这一行。从代码中排除此行并运行。最后一个子项和子项下的父项没有空间。请告诉我它将如何工作。我是一名新开发人员PLZ为什么我们在childdivided中使用颜色在XML中使用此代码,并在样式内的颜色文件中定义常量“child\u divider\u color”这只是可选的,如果您不想使用,请忽略这一行。从代码中排除此行并运行。最后一个子项和子项下的父项没有空间。
Try this code:-
<ExpandableListView
android:id="@+id/eventplanning_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:childDivider="@color/child_divider_color"
android:clipChildren="true"
android:clipToPadding="true"
android:divider="@color/child_divider_color"
android:dividerHeight="0.5dp"
android:groupIndicator="@null"
android:paddingLeft="20dp"
android:paddingRight="20dp"
android:scrollIndicators="none"
android:scrollbars="none"
android:transitionGroup="true"/>