这是我后来发现的一种方法,是用android中design包里的控件。
布局代码如下:
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_width="match_parent"
android:layout_height="48dp"
android:background="@color/colorPrimary"/>
android:layout_width="match_parent"
android:layout_height="match_parent">
android:layout_width="match_parent"
android:layout_height="185dp">
android:layout_width="match_parent"
android:layout_height="140dp"
app:contentScrim="#FFFFFF"
app:layout_scrollFlags=