实在不知道标题写啥,瞎扯淡
就看看静态图吧,懒得做gif
把这个抽烟的兄弟往上拉之后
直接贴代码,只有布局
<?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent"> <ImageView android:layout_width="match_parent" android:layout_height="match_parent" android:background="@drawable/aaa"/> <LinearLayout app:behavior_peekHeight="220dp" app:layout_behavior="@string/bottom_sheet_behavior" android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" android:background="@drawable/ret_white" android:layout_margin="30dp"> <ImageView android:layout_width="match_parent" android:layout_height="220dp" android:src="@drawable/index"/> <android.support.v4.widget.NestedScrollView android:layout_width="match_parent" android:layout_height="wrap_content"> <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="@string/bbb"/> </android.support.v4.widget.NestedScrollView> </LinearLayout> </android.support.design.widget.CoordinatorLayout>
关键就是这两句
app:behavior_peekHeight="220dp" app:layout_behavior="@string/bottom_sheet_behavior"ok,就这样吧!