BottomSheetBehavior is not work when design library update to 24.2.0

前端 未结 2 557
北海茫月
北海茫月 2020-12-31 10:14

BottomSheetBehavior work properly in

compile \'com.android.support:design:24.1.1\'

but when I update it to 24.2.0,it is not work.Is that a

2条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-31 10:49

    Updated August 30th, 2016

    The accepted answer explains the difference between STATE_HIDDEN and STATE_COLLAPSED and how to correctly use both in com.android.support:design:24.2.0.

    As of August 20th, 2016

    Although this does seem to be a bug with com.android.support:design:24.2.0, you can temporarily work around it by using BottomSheetBehavior.STATE_HIDDEN:

    mBehavior.setHideable(true);
    mBehavior.setState(BottomSheetBehavior.STATE_HIDDEN);
    

    This will still close the bottom sheet with an animation.

    I'm not sure what the actual difference between STATE_COLLAPSED and STATE_HIDDEN is, and the documentation is less than helpful, but until it's actually fixed I think STATE_HIDDEN is okay.

提交回复
热议问题