首页 > 解决方案 > 带有手势导航的 Bottomsheetbehavior 行为异常

问题描述

还有其他人在他们的应用程序中遇到底页行为问题吗?特别是关于使用启用了手势导航的手机时的窥视高度?

关闭手势导航的底部工作表

带有手势导航的底部工作表

标签: androidxmlpixelgesturebottom-sheet

解决方案


我在我的应用程序中遇到了同样的问题,我使用自定义插入解决了它( 手动使用插入

override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
...
        ViewCompat.setOnApplyWindowInsetsListener(binding.rootView) { _, insets ->
        val systemGestureInsets = insets.systemGestureInsets
        WindowInsetsCompat.Builder()
            .setSystemWindowInsets(insets.systemWindowInsets)
            .setSystemGestureInsets(systemGestureInsets).build()
    }
...
}

推荐阅读