Show and Hide Bottom Sheet Programmatically

后端 未结 4 673
青春惊慌失措
青春惊慌失措 2020-12-25 10:27

I have implemented Bottom Sheet functionality within my activity in onCreate() using this solution and this library

   sheet = new BottomSheet.Builder(this,          


        
4条回答
  •  隐瞒了意图╮
    2020-12-25 11:16

    For showing the Bottom Sheet use this code:

    bottomSheetInfoBehavior.setHideable(false);
    bottomSheetInfoBehavior.setState(BottomSheetBehavior.STATE_EXPANDED);
    

    For Hiding the Bottom sheet use this code:

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

提交回复
热议问题