问题描述
我使用的视图 CoordinatorLayout
从 android.support.design
我的主要问题是,你怎么可以附加在应用程序:layout_behavior
的片段RecyclerView
I am using the view CoordinatorLayout
from android.support.design
my main problem is that how can you attach the app:layout_behavior
to the fragments RecyclerView?
在由谷歌所举的例子,他们只能将其连接在该 CoordinatorLayout
附有相同的XML文件的RecyclerView。
In the example given by google they only attach it in the RecyclerView of the same xml file where the CoordinatorLayout
was attached.
有没有办法来CoordinatorLayout附加到片段RecyclerView的ViewPager?
Is there a way to attach CoordinatorLayout to the Fragments RecyclerView within the ViewPager?
该示例是here:
推荐答案
这可能是愚蠢的,但它并没有因为这一事实,即构建工具并没有在 build.gradle更新工作
的应用程序版本为22,我用的是21,这就是为什么它不工作的预计。
This might be dumb, but it didn't worked due to the fact that the build tool was not updated in the build.gradle
of the application version to 22, I was using 21 that is why it is not working as expected to be.
编辑:
还有什么SanderTuit说:加入 com.android.support:recyclerview-v7:22.2.0
也将解决这个问题
Also what SanderTuit said: adding com.android.support:recyclerview-v7:22.2.0
will also solve the problem
这篇关于CoordinatorLayout使用viewpager的recyclerview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!