Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/194.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 为ExpandableListView使用CursorTreeAdapter时删除组指示符_Android_Expandablelistview - Fatal编程技术网

Android 为ExpandableListView使用CursorTreeAdapter时删除组指示符

Android 为ExpandableListView使用CursorTreeAdapter时删除组指示符,android,expandablelistview,Android,Expandablelistview,当对ExpandableListView使用CursorTreeAdapter时,是否有API或任何官方方法删除没有子项的项的组指示符 救命啊!非常感谢。我在这件事上挣扎了很长一段时间,我最终的做法是在ExpandableListView中完全隐藏GroupIndicator <ExpandableListView android:id="@+id/android:list" android:layout_below="@id/technical_details_label_separ

当对ExpandableListView使用CursorTreeAdapter时,是否有API或任何官方方法删除没有子项的项的组指示符


救命啊!非常感谢。

我在这件事上挣扎了很长一段时间,我最终的做法是在ExpandableListView中完全隐藏GroupIndicator

  <ExpandableListView android:id="@+id/android:list"
android:layout_below="@id/technical_details_label_separator"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_weight="1"
android:drawSelectorOnTop="false"
android:groupIndicator="@android:color/transparent"
/>

然后我创建了一个扩展BaseExpandableListAdapter的自定义适配器,并实现了getGroupView方法,在这个方法中,您可以创建一个带有ImageView的视图,您可以手动切换以扩展或收缩组(使用isExpanded标志),如果组为空,则完全隐藏它


,布尔值,android.view.view,android.view.ViewGroup)

我试图将状态列表drawble设置为GroupIndicator。没用,我也在做类似的事,谢谢,尤卡斯。这是一个很好的解决办法。但如果是这样,我们就不能使用系统默认的组指示器外观。是的,这是真的……但正如我所说的,其他解决方案对我不起作用。我尝试了一个可绘制的状态列表,但它的主要问题是“空”组与未扩展组相同。我将SDK数据中的group indicator Drawable复制到我的项目中,以至少为某些设备提供系统默认外观Jucas,您是否尝试使用扩展CursorTreeAdapter的子类?在这种情况下,你的解决方案不起作用。Lei,我还没有尝试过,我猜CursorTreeAdapter会自己绘制它