直播网站源码,RecycleView实现item重叠水平滑动
装饰器第一个item不偏移,其他item向左偏移一定距离,代码为:
mRecyclerView.addItemDecoration(new RecyclerView.ItemDecoration() {
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
if (parent.getChildPosition(view) != (0)) {
outRect.left = -6;
}
}
});
以上就是直播网站源码,RecycleView实现item重叠水平滑动, 更多内容欢迎关注之后的文章
标签:outRect,RecycleView,item,直播,滑动,源码 From: https://www.cnblogs.com/yunbaomengnan/p/17579739.html