【发布时间】:2019-12-11 05:59:05
【问题描述】:
layout_behavior - android.support.design.widget.BottomSheetBehavior 不工作
此视图在运行时不受垂直限制,它会跳转
我仅在 Androidx 中收到此错误。那么我该如何解决这个错误。
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android="http://schemas.android.com/apk/res/android"
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"
android:background="#efefef"
tools:context=".MainActivity">
<include layout="@layout/content_main" />
<!-- Adding bottom sheet after main content -->
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/bottom_sheet"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#fff"
android:orientation="vertical"
android:padding="10dp"
app:behavior_hideable="true"
app:behavior_peekHeight="56dp"
app:layout_behavior="android.support.design.widget.BottomSheetBehavior">
...... child layouts..
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
【问题讨论】:
标签: android android-support-library androidx bottom-sheet material-components