Android 使用手势而不是导航按钮时 BottomSheet 峰值高度问题

BottomSheet Peak Height problem when Android is using gesture instead of Navigation Button

我在坐标布局中有一个 BottomSheet。在正常情况下可以完美运行。当 Android 使用屏幕手势而不是导航按钮时出现问题。

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/episode_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/black"
app:behavior_hideable="false"
app:behavior_peekHeight="0dp"
app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

在 android 中使用导航按钮时

使用手势导航时

我试过否定 app:behavior_peekHeight 但它不起作用。但是当我给出 app:behavior_peekHeight="@dimen/_45sdp" 时,它显示了播放器控制器,但也显示了底部布局。我想隐藏底部布局。

最后,我使用

修复了它
bottomSheetBehavior.setGestureInsetBottomIgnored(true);