当前位置:网站首页>Recycleview realizes horizontal sliding of overlapping items
Recycleview realizes horizontal sliding of overlapping items
2022-07-25 06:32:00 【Zhang Hailong_ China】

The design drawing is shown above : The back avatar overlaps , The core is : Decorator first item No deviation , other item Offset a certain distance to the left , The code is :
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 The code inside is not posted . The core idea is that the spacing of decorators is negative , Achieve overlapping effect
边栏推荐
- MySQL中建表时 pk、nn、qu、b、un、zf、ai、g代表的意思
- C#控件开源库:MetroFramework的下载
- Date (day 76)
- Qt 5界面修改无效的问题解决QtDesigner修改之后无效的解决办法
- C control open source library: download of metroframework
- 【transformer】DeiT
- Quick sort code implementation
- “font/woff“ and “font/woff2“ in file “mime.types“
- Temperature table lookup and calculation formula
- Using JS to realize the linkage effect of form form's secondary menu
猜你喜欢

Bug notes

你了解PowerBI中的去年同期吗

Koa2 learning

How to convert multi row data into multi column data in MySQL

Keilc51 usage details (III)

Evolution of coupon architecture under C2B mode

R strange grammar summary

Easy to understand: basic knowledge of MOS tube

【Unity3D】UGUI回调函数

C#--MetroFramework框架调用metroModernUI库,并在工具栏使用
随机推荐
【C语言】指针和数组的深入理解(第一期)
Android interview question: why do activities rebuild ViewModel and still exist—— Jetpack series (3)
Classic cases of static keywords and block blocks
[C language] document processing and operation
Clear wechat applet and wechat H5 cache
Data too long for column 'data' at row 1 and the garbled code caused by setting to longblob are solved. node-mysql
Design of automatic machine dot drawing script based on C language
“font/woff“ and “font/woff2“ in file “mime.types“
NFT: how to improve rentable NFT (erc-4907)
Typedef usage and template
Machine learning keras fitting sine function
EXCEL
Multithreading programming under Win32 API
Common API of window
JVM tuning summary -xms -xmx -xmn -xss
target_compile_features specified unknown feature “cxx_std_14“ for target
JS gets the text selected by the mouse and is in the selected state
在C# WinForms应用程序中安装,配置和使用MetroFramework
Dry goods | training AI model can't find data? Collect 20 selected open source communities!
[sword finger offer] analog implementation ATOI