Expandable list view move group icon indicator to right

前端 未结 16 2453
栀梦
栀梦 2020-12-04 08:56

As regards to expandable list view, the group icon indicator is positioned to the left side, can I move the indicator and positioned it to the right? Thanks.

16条回答
  •  鱼传尺愫
    2020-12-04 09:44

    I'm using the following short piece inspired by this sample that requires two drawables on the folder:

    if (isExpanded) {
        ListHeader.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.up, 0);
    } else {
        ListHeader.setCompoundDrawablesWithIntrinsicBounds(0, 0, R.drawable.down, 0);
    } 
    

    Anyway, I had to adopt goodKode's solution as well "to get rid off" the default arrows.

    So, I'd advise to stick with the simple solution previously provided as it's the most minimalist and precise approach.

提交回复
热议问题