转自:GMAIL 邮件列表 http://comments.gmane.org/gmane.comp.handhelds.android.devel/82840
==================================================
I've been fighting with styling on ExpandableListView as well (an area
that could use some improvement in a future release).
The problem with the current implementation is in the selector element
for the group expander. It can be found in expander_group.xml and
looks like this:
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:state_expanded="true"
android:drawable="@drawable/expander_ic_maximized" />
<item
android:drawable="@drawable/expander_ic_minimized" />
</selector>
The problem is that it lacks a state for empty. The code and
attributes support it (state_empty) but it isn't defined in here.
Here are the hypothetical (completely untested) steps you could use to
achieve this:
- Grab the existing expander_group.xml and put it into your drawable
directory.
- Modify it to include a section for the empty state with no image.
Something like this:
<item android:state_empty="true" android:drawable="@drawable/
empty"/>
- Modify your ExpandableListView element and set the group indicator
to be your private expander_group.xml
Let us know how it works out. For myself, I need even more control so
I'm about to move to the "roll my own" stage.
======================分割线==================================
貌似这是个仍未修复的BUG,即便写了如下代码,问题仍然存在!
<item android:state_empty="true" android:drawable="@drawable/
empty"/>
分享到:
相关推荐
android ExpandableListView的group和child都有checkbox,而且group默认展开,点击后不收起child。
本demo实现功能为:Expandablelistview子项checkBox先获取已选择状态,在次过程中可修改子项选择,最终提交选择子类的项,并打印相关数据
android ExpandableListView三级菜单的使用,多级菜单下拉与隐藏,ExpandableListView的简单使用
android ExpandableListView简单例子
Android ExpandableListView双层嵌套实现三级树形菜单
android ExpandableListView 四级树形目录 可无限延伸。
点击ExpandableListView头部时,子集动态加载。已有子集不重新加载。 ExpandableListView滚动时,头部孤独。 IphoneTreeView功能
您可能已经看到了一个标准的ListView的实现。你也可能已经看到ExpandableListView一个标准的实现。然而,最近我的项目需要在屏幕方面使用这两种类型的...复杂的问题,这些名单被要求处理两套不同的数据显示不同的布局。
前几篇文章介绍了Listview,但在实际开发中也经常会用到多层的Listview来展示数据,比如qq中的好友展示,所以这张来了解一下ExpandableListview,基本思想与Listview大致是相同的,所以用起来会比较方便。
android学习基础知识,不懂的童鞋看看,一定有收获的~
android中ExpandableListView嵌套GridView的使用
Android之ExpandableListView控件的使用
Android实现自定义适配器的ExpandableListView示例,准备一级列表中显示的数据:2个一级列表,分别显示"group1"和"group2",准备第一个一级列表中的二级列表数据:两个二级列表,分别显示"childData1"和"childData2",...
在android中,以往用的比较多的是listview,虽然可以实现列表的展示,但在某些情况下,我们还是希望用到可以分组并实现收缩的列表,那就要用到android的ExpandableListView
基于Android中的ExpandableListView开发示例, 应用list集合类型
CommentWithReplyView-master 基于ExpandableListView实现评论和回复的功能。 > 说明 ...处理了NestedScrollView、ExpandableListView和CoordinatorLayout的嵌套问题 点击某条评论,即可@ta进行回复
包括listview ExpandableListView有悬停标示,
Android ExpandableListView组件与PopupWindow组件的完美结合,数据来源于json。
ExpandableListView的group和child里面都含有CheckBox框,二者联动。