anko
anko copied to clipboard
Implementing BottomSheetBehavior
Hi everyone.
I'm trying to implement a BottomSheetBehavior but i can't find a way to set the behavior in a linearlayout.
I get the error The view is not associated with BottomSheetBehavior every time, and I didn't find any example or issue related to this in anko.
Can you help me please?
I meet same issue
You can set up the behavior manually like this:
nestedScrollView {}.lparams(width = matchParent, height = matchParent) {
val bottomSheetBehavior = BottomSheetBehavior<NestedScrollView>()
bottomSheetBehavior.peekHeight = 0
bottomSheetBehavior.isHideable = false
// this calls CoordinatorLayout.LayoutParams.setBehavior
behavior = bottomSheetBehavior
}