在用BottomSheet的时候一直报这个错误
检查了很久,最后才发现我是直接在原始的xml写布局,原始布局是
<?xml version="1.0" encoding="utf-8"?>
<android.support.constraint.ConstraintLayoutxmlns
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
>
<Button
android:layout_width="wrap_content"
android:layout_gravity="center"
android:layout_height="wrap_content"
android:onClick="dd" />
<android.support.v4.widget.NestedScrollView
android:layout_gravity="center_horizontal"
android:id="@+id/ll"
app:layout_behavior="@string/bottom_sheet_behavior"
app:behavior_hideable="true"
app:behavior_peekHeight="50dp"
android:layout_width="300dp"
android:layout_height="wrap_content">
<LinearLayout
app:layout_behavior="@string/bottom_sheet_behavior"
android:background="#817e7e"
android:layout_width="match_parent"
android:orientation="vertical"
android:layout_height="match_parent">
<Button
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button" />
<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="100dp"
android:text="Button" />
<SeekBar
android:id="@+id/seekBar"
android:layout_width="match_parent"
android:layout_height="56dp" />
</LinearLayout>
</android.support.v4.widget.NestedScrollView>
</android.support.constraint.ConstraintLayout>
注意第一行是android.support.constraint.ConstraintLayoutxmlns!!!!是约束布局
把余数布局改成CoordinatorLayout就可以了。。。。。简直坑爹!