Android expandable listview child divider

时间:2016-02-03 04:01:42

标签: android expandablelistview

I have an expandable listview with child view, when ever i click on group view it will expand and display child view, i have to hide divider between parent and child only for the expanded group also make it visible when it collapse, am using default divider, how can i do this.?

1 个答案:

答案 0 :(得分:1)

这是完美的解决方案。

隐藏子分隔符,将其颜色设置为transparent #00000000

color.xml 文件中定义透明

<color name="transparent">#00000000</color>

然后设置子分隔符

listView.setChildDivider(getResources().getDrawable(R.color.transparent))

布局xml 文件

<ExpandableListView 
android:layout_width="fill_parent"
android:layout_height="fill_parent" 
android:childDivider="#00000000"/>

这里是输出:

enter image description here

有关详细信息,请访问此处。

Android: Hide child dividers in ExpandableListView