Moosphan / Android-Daily-Interview

:pushpin:每工作日更新一道 Android 面试题,小聚成河,大聚成江,共勉之~

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

2019-05-08:谈谈自定义LayoutManager的流程?

MoJieBlog opened this issue · comments

2019-05-08:谈谈自定义LayoutManager的流程?

onLayoutChildren 布局

没有自定义过

露出来和我头像一样的神情

打卡打卡

明天看看相关的 学习一波

1.确定Itemview的LayoutParams
generateDefaultLayoutParams

2.确定所有itemview在recyclerview的位置,并且回收和复用itemview
onLayoutChildren

3.添加滑动
canScrollVertically

重点其实是 回收和复用itemview,你需要判断什么时候回收itemview,什么时候复用itemview

https://blog.csdn.net/m0_37796683/article/details/104864318
理解RecyclerView(五)—RecyclerView的绘制流程