import android.graphics.Rect; import android.support.v7.widget.RecyclerView; import android.view.View; /** * Created by 郑振楠 on 2017/6/19. */ public class SpaceItemDecoration extends RecyclerView.ItemDecoration { private int space; public SpaceItemDecoration(int space) { this.space = space; } @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { if(parent.getChildPosition(view) != -1) outRect.top = space; } }最后调用: recycle_view.addItemDecoration(new SpaceItemDecoration(15));