在Kotlin中单击外部时如何消除底部片段?

问题描述 投票:1回答:1

我像这样制作底页片段:

val bottomSheet = PictureBottomSheetFragment(fragment)
bottomSheet.isCancelable = true
bottomSheet.setListener(pictureListener)
bottomSheet.show(ac.supportFragmentManager, "PictureBottomSheetFragment")

但是当我触摸外面时,它不会消失。并关闭或isCancelable不起作用。

android kotlin bottom-sheet android-bottomsheetdialog
1个回答
0
投票

尝试一下

behavior.setState(BottomSheetBehavior.STATE_HIDDEN));
© www.soinside.com 2019 - 2024. All rights reserved.