转自: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"/>

更多相关文章

  1. android 应用 Ant脚本自动编译、打包、代码混淆、签名、安装等
  2. Android中处理代码未捕获异常
  3. Android时间互换代码
  4. 【Android Demo】获取指定网页的页面源代码
  5. Android开源项目:捕鱼达人游戏源代码
  6. 利用productFlavors实现一套代码打包多版本
  7. android sql 批量处理插入/修改/删除 操作通用代码
  8. Android功能代码
  9. Android中通过代码修改bitmap的宽高

随机推荐

  1. Android一些学习的小点
  2. 使用Android(安卓)design support librar
  3. Android底部菜单栏 仿微博效果
  4. 在 Ubuntu 下使用 Android(安卓)NDK r4b
  5. Android(安卓)中的WiFi学习笔记——经典
  6. pandaboard ES学习之旅——4 Android源代
  7. 最新下载 android 源码方法
  8. Android(安卓)Utils
  9. android Wifi自动连接
  10. Android的数据存储之一------SharedPrefe