android expandablelistview how to set space between groups items

后端 未结 6 1490
别那么骄傲
别那么骄傲 2020-12-30 12:24

I have expandablelistview and I want to add padding (or margin) between the groups items, I used margin-botton on the group items, it works but now it is also a

6条回答
  •  没有蜡笔的小新
    2020-12-30 13:02

    I was having the same kind of problem so i came up with a childish solution. What i did was i added to linear layout with same properties both in parent layout file and child layout file of expandable list view. And when a group is clicked i made the 'linear layout' of parent layout file invisible and my work was done.

    Group Layout File

    
    
    
    

    Child Layout File

    
    
    
    

    To hide the linear layout when any group is clicked Add this line into addChildView method in the adapter class

    lv.setVisibility(View.INVISIBLE);
    

    here lv contains the id of the linear layout

    linear_parent_faq

    of group layout file.

提交回复
热议问题