当前位置:网站首页>RecyclerView Item 根据 x,y 坐标得到当前position(位置)
RecyclerView Item 根据 x,y 坐标得到当前position(位置)
2022-06-26 08:20:00 【LeeStudio_】
RT
public int findItem(int x, int y) {
View childViewUnder = binding.recyclerview.findChildViewUnder(x, y);
if (childViewUnder != null) {
RecyclerView.ViewHolder childViewHolder = binding.recyclerview.getChildViewHolder(childViewUnder);
if (childViewHolder != null) {
return childViewHolder.getAdapterPosition();
}
}
return -1;
}
边栏推荐
- (vs2019 MFC connects to MySQL) make a simple login interface (detailed)
- Chapter 4 (functions and preprocessing)
- What is Qi certification Qi certification process
- Real machine debugging of uniapp custom base
- JMeter performance testing - Basic Concepts
- Crawler case 1: JS reversely obtains HD Wallpapers of minimalist Wallpapers
- 2020-10-17
- 监听iPad键盘显示和隐藏事件
- Understanding of closures
- What if the service in Nacos cannot be deleted?
猜你喜欢

Pychart connects to Damon database

Oracle database self study notes

MySQL practice: 4 Operation of data

Win11 open folder Caton solution summary

Quickly upload data sets and other files to Google colab ------ solve the problem of slow uploading colab files

Calculation of decoupling capacitance

Chapter VIII (classes and objects)

Chapter 3 (data types and expressions)

xxl-job配置告警邮件通知

Chapter 5 (array)
随机推荐
CodeBlocks集成Objective-C开发
How to Use Instruments in Xcode
Apple motherboard decoding chip, lightning Apple motherboard decoding I.C
Listview control
Chapter II (summary)
Wechat applet beginner level chapter
Interpretation of x-vlm multimodal model
Macro task, micro task, async, await principle of interview
optee中支持的时间函数
Introduction of laser drive circuit
optee中的timer代码导读
StarWar armor combined with scanning target location
CodeBlocks integrated Objective-C development
js文件报无效字符错误
Uniapp wechat withdrawal (packaged as app)
Recognize the interruption of 80s51
Hand drawn style chart library chart Implementation principle of xkcd
The 9th zero code training camp is officially open for registration! (Beijing, Shanghai, Guangzhou and Shenzhen)
How to debug plug-ins using vs Code
Batch modify file name