参考引入的新Android设计支持库;我的问题是:
Recycler视图是否适用于协调器布局?
因为我在没有回收者视图的情况下工作时能够完美地获得滚动效果;但没有使用它。
所以我只是想知道是否有人参与其中。
我正在尝试这样的事情
<android.support.design.widget.CoordinatorLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<include
android:id="@+id/app_bar_layout"
layout="@layout/my_toolbar" />
<android.support.v7.widget.RecyclerView
android:id="@+id/pmp_list"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@id/app_bar"
android:scrollbars="vertical"
app:layout_scrollFlags="scroll|enterAlways"
app:layout_behavior="@string/appbar_scrolling_view_behavior" />
</android.support.design.widget.CoordinatorLayout>
答案 0 :(得分:1)
浪费了几个小时后,我发现我使用的是旧版本的库:
compile 'com.android.support:recyclerview-v7:21.0.+'
请确保将其更新为最新版本:
compile 'com.android.support:recyclerview-v7:22.2.0'
以下链接非常有帮助:
http://blog.grafixartist.com/material-design-tabs-with-android-design-support-library/