animateLayoutChanges=“true” in BottomSheetView showing unexpected behaviour

后端 未结 4 527
没有蜡笔的小新
没有蜡笔的小新 2021-01-31 15:24

I have a BottomSheetView which has animateLayoutChanges=\"true\". Initially it shows up fine. But if change the visibility of a view (insi

4条回答
  •  清歌不尽
    2021-01-31 16:05

    In the BottomSheetDialog default layout (design_bottom_sheet_dialog) there is a TOP gravity on the dialog's design_bottom_sheet FrameLayout:

     android:layout_gravity="center_horizontal|top"
    

    I don't really know why on BottomSheetDialog gravity is top.

    You need to create the same layout file (same content and name) in your project and replace this line with:

    android:layout_gravity="center_horizontal|bottom"
    

提交回复
热议问题