anko icon indicating copy to clipboard operation
anko copied to clipboard

Implementing BottomSheetBehavior

Open knightlore opened this issue 7 years ago • 2 comments

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?

knightlore avatar Mar 19 '18 22:03 knightlore

I meet same issue

HakuLess avatar Jul 27 '18 04:07 HakuLess

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
            }

blastrock avatar Mar 03 '19 15:03 blastrock