当前位置:网站首页>How to put recyclerview in nestedscrollview- How to put RecyclerView inside NestedScrollView?
How to put recyclerview in nestedscrollview- How to put RecyclerView inside NestedScrollView?
2022-07-07 23:54:00 【Bustling city 】
problem :
With creation of NestedScrollView you can put scrolling view inside another scrolling view as long as those implement NestedScrollingChild and NestedScrollingParent correctly. By creating a NestedScrollView, You can put the scroll view in another scroll view , As long as they are implemented correctly NestedScrollingChild and NestedScrollingParent .
(This is not bad design pattern "Ian Lake (from Google) actually recommends putting a RecyclerView
inside a nestedscrollview here: plus.google.com/u/0/+AndroidDevelopers/posts/9kZ3SsXdT2T")( This is a good design pattern “Ian Lake( From Google ) In fact, it is suggested that RecyclerView
Put it in nestedscrollview in :plus.google.com/u/0/+AndroidDevelopers/posts/9kZ3SsXdT2T”)
I want to put RecyclerView inside NestedScrollView and fortunately RecyclerView implements NestedScrollingChild so you can put it inside NestedScrollView . I want to put RecyclerView Put it in NestedScrollView Inside , Fortunately, RecyclerView Realized NestedScrollingChild So you can put it in NestedScrollView Inside .
public class RecyclerView extends ViewGroup implements ScrollingView, NestedScrollingChild
I have read these posts: I have read these posts :
How to use RecyclerView inside NestedScrollView? How to be in NestedScrollView Use in RecyclerView?
NestedScrolling with NestedScrollView, RecyclerView (Horizontal), inside a CoordinatorLayoutNestedScrolling And NestedScrollView、RecyclerView( level ), stay CoordinatorLayout Inside
But the problem with most voted solution is, it calls all of the items of RecyclerView
so for example if it is an endless RecyclerView and when the user reaches the end of the list you want to make a network request then with that solution the RecyclerView
calls server repeatedly because it automatically reaches the last item of RecyclerView
. But the problem with most voting solutions is , It calls RecyclerView
All items , for example , If it is an endless RecyclerView, And when the user reaches the end of the list , You want to make a network request , Then use the solution RecyclerView
The calling server repeats , Because it will arrive automatically RecyclerView
The last item of .
Anyway, how to set parameter so I can put RecyclerView
inside NestedScrollView
.(actually I want to put a viewgroup like framelayout or relativelayout as a single childe of nestedscrollview and then I want to put recyclerview inside framelayout or relativelayout) in any case , How to set parameters so that I can set RecyclerView
Put it in NestedScrollView
.( In fact, I want to be like framelayout or relativelayout Such a view group acts as nestedscrollview A single sub object of , Then I want to recyclerview Put it in framelayout or relativelayout in )
When I put RecyclerView
inside NestedScrollView
there is nothing to display. When I will RecyclerView
Put it in NestedScrollView
, There is nothing to show .
In order to create a sample project you can use cheesesquare and change the CheeseDetailActivity
to have a RecyclerView. To create it, you can use the sample project cheesesquare And change CheeseDetailActivity
Yes RecyclerView.
Although the answer of BNK is not correct but BNK has tried a lot. although BNK Your answer is incorrect , but BNK I have tried a lot .So I award him the bounty. So I gave him a reward .Still looking for nice solution.... Still looking for a good solution ......
Solution :
Reference resources : https://stackoom.com/en/question/2Fqku边栏推荐
- Balanced binary tree [AVL tree] - insert, delete
- Flash download setup
- Chisel tutorial - 02 Chisel environment configuration and implementation and testing of the first chisel module
- Redis caching tool class, worth owning~
- Data analysis series 3 σ Rule / eliminate outliers according to laida criterion
- C - minute number V3
- Opengl3.3 mouse picking up objects
- UIC564-2 附录4 –阻燃防火测试:火焰的扩散
- 【史上最详细】信贷中逾期天数统计说明
- Rectification characteristics of fast recovery diode
猜你喜欢
【史上最详细】信贷中逾期天数统计说明
【路径规划】使用垂距限值法与贝塞尔优化A星路径
Wechat applet development beginner 1
One click free translation of more than 300 pages of PDF documents
P1067 [noip2009 popularity group] polynomial output (difficult, pit)
[path planning] use the vertical distance limit method and Bessel to optimize the path of a star
AITM3.0005 烟雾毒性测试
全自动化处理每月缺卡数据,输出缺卡人员信息
平衡二叉樹【AVL樹】——插入、删除
c—线性表
随机推荐
HB 5469民用飞机机舱内部非金属材料燃烧试验方法
神奇快速幂
P2141 [noip2014 popularization group] abacus mental arithmetic test
一个测试工程师的7年感悟 ---- 致在一路独行的你(别放弃)
一鍵免費翻譯300多頁的pdf文檔
Access database query all tables SQL
Come on, brother
在网页中打开展示pdf文件
Alibaba cloud MySQL cannot connect
QT and OpenGL: loading 3D models using the open asset import library (assimp) - Part 2
C - linear table
每日刷题记录 (十六)
SQL uses the in keyword to query multiple fields
C - Fibonacci sequence again
10 schemes to ensure interface data security
【leetcode】day1
Get started with mongodb
SQL connection problem after downloading (2)
95.(cesium篇)cesium动态单体化-3D建筑物(楼栋)
postgres timestamp转人眼时间字符串或者毫秒值