yqritc/RecyclerView-FlexibleDivider

the divider show in left and right even if set margin

Sum41forever opened this issue · 2 comments

image

HorizontalDividerItemDecoration mItemDecoration = new HorizontalDividerItemDecoration.Builder(this)
                .color(ContextCompat.getColor(mContext, R.color.color_333333))
                .sizeResId(R.dimen.px_1)
                .marginResId(R.dimen.dp_16, R.dimen.dp_16)
                .build();
mRecyclerView.addItemDecoration(mItemDecoration);

I also have this issue. Any solutions ?

This will be caused by the fact that the divider is drawn "outside" of the items which have the white background. So what you see is the color of the background below your items.