自定义ItemDecoration设置分割线

说道ItemDecoration不得不说三个方法:

/**
* @param c 画布
* @param parent RecyleView
* @param state RecyclerView的当前状态
*/
@Override(http://www.my516.com)
public void onDraw(Canvas c, RecyclerView parent,RecyclerView.State state) {
1
2
3
4
5
6
7
8
/**
* @param outRect
* @param view RecycleView的itemView
* @param parent RecycleView
* @param state RecycleView 的状态
*/
@Override
public void getItemOffsets(Rect outRect,View view, RecyclerView parent, RecyclerView.State state)
1
2
3
4
5
6
7
8
/**
* @param c 画布
* @param parent RecycleView
* @param state RecycleView的状态
*/
@Override
public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state)
————————————————

posted on 2019-08-28 22:16  激流勇进1  阅读(661)  评论(0编辑  收藏  举报