Expandable list view move group icon indicator to right

前端 未结 16 2431
栀梦
栀梦 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:52

    setIndicatorBounds(int, int) does not work properly for Android 4.3. They introduced a new method setIndicatorBoundsRelative(int, int) which works ok for 4.3.

    @Override
    public void onWindowFocusChanged(boolean hasFocus) {
        super.onWindowFocusChanged(hasFocus);
        if(android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.JELLY_BEAN_MR2) {
           mExpandableListView.setIndicatorBounds(myLeft, myRight);
        } else {
           mExpandableListView.setIndicatorBoundsRelative(myLeft, myRight);
        }
    }
    

提交回复
热议问题