我试图用材料设计指南制作我的应用程序,但我遇到了问题。我试图使用滚动技术,但不能在手机上工作。我在互联网上看了一眼,但我发现自己的错误。这是我的xml:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
xmlns:app="http://schemas.android.com/apk/res-auto"
tools:context="com.kriegerlab.recyclerview.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<android.support.v7.widget.Toolbar
android:id="@+id/toolbar"
android:layout_height="48dp"
android:layout_width="match_parent"
android:background="@color/colorPrimary"
app:layout_scrollFlags="scroll|enterAlways"
android:fitsSystemWindows="true">
</android.support.v7.widget.Toolbar>
</android.support.design.widget.AppBarLayout>
<android.support.v7.widget.RecyclerView
android:id="@+id/my_recycler_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
app:layout_behavior="@string/appbar_scrolling_view_behavior"/>
任何关于错误的地方?提前谢谢!
答案 0 :(得分:0)
OK!我解决了这个问题:
app:layout_scrollFlags="scroll|enterAlwaysCollapsed"