Comments (15)
好的 可以了就行哈
from byrecyclerview.
头部的appBarLayout可以使用appBarLayout.setExpanded(true);
这个是展开的操作,看是否符合你的需求
from byrecyclerview.
可以监听recyclerView,处于停止的时候再执行appBarLayout.setExpanded(true);
recyclerView.addOnScrollListener(new RecyclerView.OnScrollListener() {
@Override
public void onScrolled(@NonNull RecyclerView recyclerView, int dx, int dy) {
super.onScrolled(recyclerView, dx, dy);
}
@Override
public void onScrollStateChanged(@NonNull RecyclerView recyclerView, int newState) {
super.onScrollStateChanged(recyclerView, newState);
if (newState == RecyclerView.SCROLL_STATE_IDLE) {
appBarLayout.setExpanded(true);
}
}
});
也是需要执行scrollToPosition(0),或者是recyclerView.smoothScrollToPosition(0);
from byrecyclerview.
这个问题解决了我先把PersistentRecyclerView scrollToposition(0) 然后设置appBarLayout的topAndBottomOffset为0这样可以到达顶部然后进行刷新
from byrecyclerview.
但是现在有一个新的问题,内部的PersistentRecyclerView 他的item又有一个recyclerView,这个recyclerView不但会和PersistentRecyclerView 滑动冲突,我重写了item中的recyclerView的dispatchTouchEvent,内部拦截,但是他好像和appBarLayout又有冲突
from byrecyclerview.
一般是建议是item不要有recyclerView,有的话应该也是要设置一个横向的recyclerView,如果是纵向的本身就会有问题。
如果是横向的我还有解决方式,我们之前的项目中有处理横向的情况。
from byrecyclerview.
项目要求这样实现没办法,大佬有解决办法吗。。。现在的现象是AppBarLayout收缩吸顶的情况下PersistentRecyclerView 还没有滑动到顶部,这个是滑动item的recyclerView时,会直接把appBarLayout拉下来,
from byrecyclerview.
你可以将纵向的recyclerView可以设置为横向的呀,将纵向的条数作为span处理,能理解吗
from byrecyclerview.
没有太明白你说的转换成横向span处理是什么意思,我这个item的recyclerView纵向用于显示台词就一个textview
from byrecyclerview.
你设置成横向的recyclerView,横向的行数有[list.size],列数只有一列,可行吗
from byrecyclerview.
不行啊,他必须要纵向滚动,感谢大佬的指导,我再试试能不能解决内部item的recyclerView和最外部的appBarLayout的冲突
from byrecyclerview.
好的哈
from byrecyclerview.
大佬我在内部recyclerView嵌套的item中的recyclerView设置了isNestedScrollingEnabled=false这个冲突就解决了,但是不知道原因是什么
from byrecyclerview.
感觉是rv通过isNestedScrollingEnabled=false这个属性做了处理,解决了就好哈
from byrecyclerview.
感觉是rv通过isNestedScrollingEnabled=false这个属性做了处理,解决了就好哈
from byrecyclerview.
Related Issues (20)
- 仓库下载不到资源
- item 悬浮置顶加入下拉刷新 ,悬浮错位! HOT 2
- 计划新增 侧滑和拖拽功能 HOT 3
- 计划新增 ViewBinding使用示例 HOT 1
- 计划 同步代码到gitee
- 怎样在xml绑定数据 HOT 1
- 添加headerview后,主体内容却不显示了 HOT 2
- 发现一个bug HOT 8
- setStackFromEnd = true 下拉刷新有点不正常 HOT 14
- 可以增加一个treeview的的适配器吗 HOT 4
- can show the second floor demo? HOT 1
- 希望增加一个功能 HOT 4
- 大佬,何时增加多级列表 HOT 2
- 列表在吸顶状态,然后detach再重新attach时,出现2个吸顶布局 HOT 11
- Demo中可以增加字母索引的案例吗 HOT 2
- 报废或附加的视图可能无法回收
- 大牛真厉害 HOT 1
- 给大牛ByRecyclerView提建议 HOT 8
- 嵌套和多级列表问题
- 多类型不能使用databing吗? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from byrecyclerview.