开发者

in Android ExpandableListView, how to change the margin between two groups

开发者 https://www.devze.com 2023-03-30 16:28 出处:网络
How to change the margin between two groups in an ExpandableListView? If I insert two groups into an ExpandableListView, I got the following

How to change the margin between two groups in an ExpandableListView?

If I insert two groups into an ExpandableListView, I got the following

PARENT1 (collapsed)

PARENT2 (collapsed)

How can I make it look like this?

PARENT1 (collapsed)

(some space)

PARENT2 (collapsed)

Note, I want to the space between collapsed group only. No 开发者_运维知识库space among child items


Add padding

    @Override
   public View getGroupView(final int groupPosition, final boolean isExpanded, View convertView, final ViewGroup parent) {

      ...
      convertView.setPadding(0, 30, 0, 0);

      return convertView;

    }
0

精彩评论

暂无评论...
验证码 换一张
取 消