recyclerview 行间距

public class BottomanSpaceItemDecoration extends RecyclerView.ItemDecoration {
    private int mSpace;
    private int mPosition;
    private Paint paint;
    private CircleSquareRvAdapter mRvAdapter;

    public BottomanSpaceItemDecoration(CircleSquareRvAdapter adapter, int space, int position) {
        mRvAdapter = adapter;
        this.mSpace = space;
        mPosition = position;
        paint = new Paint();
        paint.setColor(MainApplication.getInstance().getColor(R.color.red));
    }

    /**
     * Retrieve any offsets for the given item. Each field of outRect specifies
     * the number of pixels that the item view should be inset by, similar to padding or margin.
     * The default implementation sets the bounds of outRect to 0 and returns.
     * 

*

* If this ItemDecoration does not affect the positioning of item views, it should set * all four fields of

你可能感兴趣的:(Android开发,android,recyclerview,ItemDecoration)