ExpandableListView自带的小箭头样式不太好看,其实我们可以自己更换的。步骤如下:
1.隐藏ExpandableListView自带的图标。
exListView = (ExpandableListView) findViewById(R.id.ex_KnowledgeList);
exListView.setGroupIndicator(null); // 隐藏ExpandableListView自带的图标
2.设置视图展开和折叠装态的图片。
// 判断组视图是否展开
if (isExpanded) {
groupHeadHold.iv_arrow.setBackgroundResource(R.drawable.arrow_drop_down_24dp);
groupHeadHold.ll_title_name.setVisibility(View.VISIBLE);
} else {
groupHeadHold.iv_arrow.setBackgroundResource(R.drawable.arrow_drop_right_24dp);
groupHeadHold.ll_title_name.setVisibility(View.GONE);
}
看到网上还有很多自定义ExpandableListView样式的,还有把箭头改到右边的,有兴趣可以尝试下。
原文:http://my.oschina.net/u/2283209/blog/465602