当前位置:网站首页>RecycleView实现item重叠水平滑动
RecycleView实现item重叠水平滑动
2022-07-25 06:28:00 【张海龙_China】

设计图如上面显示:后面头像重叠显示,核心就是:装饰器第一个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;
}
}
});Adapter里面的代码就不贴了。核心思想就是装饰器的间距为负数,实现重叠效果
边栏推荐
- Machine learning keras fitting sine function
- JZ7 rebuild binary tree
- Some interview questions collected
- mysql数据库备份和恢复
- ARM裸板调试之JTAG调试源码级调试
- Ceres solver version 1.14 and eigen3.2.9
- JZ7 重建二叉树
- When the graduation season comes, are you ready? What are we going to do
- Openzeppelin scalable template library contract initialization details
- Developers must read: 2022 mobile application operation growth insight white paper
猜你喜欢

C#开源控件MetroFramework Demo项目下载和运行

Bug notes

HTX00001_ Keil51 bug encountered in serial port parsing

【datawhale202207】强化学习:策略梯度和近端策略优化

2022 "strong country Cup" preliminary WP (with script and detailed process)

Android interview question: why do activities rebuild ViewModel and still exist—— Jetpack series (3)

node.express中req.body总是undefind解决
![[reprint] pycharm packages.Py program as executable exe](/img/9c/02a967fb08ca54bb742cf69c4578a7.png)
[reprint] pycharm packages.Py program as executable exe
![[sword finger offer] analog implementation ATOI](/img/01/76a3b1fcc6403368a363146d553777.png)
[sword finger offer] analog implementation ATOI

Special episode of Goddess Festival | exclusive interview with Chinese AI goddess Zhang Qingqing's transformation from a female learning tyrant to a female entrepreneur
随机推荐
How to troubleshoot the problem of too many inodes
Data too long for column 'data' at row 1 and the garbled code caused by setting to longblob are solved. node-mysql
JS gets the text selected by the mouse and is in the selected state
Some common interview questions about IO stream and string
日期(DAY 76)
Bug notes
Using JS to realize the linkage effect of form form's secondary menu
Some interview questions collected
Review of three traversal methods of map
Mlx90640 infrared thermal imager temperature measurement module development notes (I)
JTAG debugging source level debugging of arm bare board debugging
Detailed annotation and analysis of start.s of uboot
Easy to understand: basic knowledge of MOS tube
【transformer】DeiT
2022 "strong country Cup" preliminary WP (with script and detailed process)
MySQL index collation summary
MySQL中建表时 pk、nn、qu、b、un、zf、ai、g代表的意思
Shell script realizes the scheduled backup of MySQL database on two computers
Scientific computing library numpy Foundation & Improvement (Understanding + explanation of important functions)
都说ScreenToGif是GIF录制神器,却不知其强大之处远不在此