开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜