Skip to content Skip to sidebar Skip to footer

How To Tie A Bottomsheet At The Bottom View Of The Layout

Through ConstraintLayout, I am using a BottomSheet to show content of a map detail. My idea is the same used in GoogleMaps, but without the image carousel at the top. I need to fi

Solution 1:

BottomSheet works only inside Coordinator Layout or as BottomSheetDialogFragment popup.

Because: app:layout_behavior is part of Coordinator Layout

It seems like at the moment there is no way of putting BottomSheet inside ConstraintsLayout, which would be awesome. They both extend view group so maybe one day, we will see capabilities of Coordinator Layout inside ConstraintsLayout or some mix of two.

Solution 2:

Set the gravity of the layout to bottom.

Solution 3:

In places_bottom_sheet.xml, change the layout_height of the root ConstraintLayout to "match_parent".

Solution 4:

Add this to bottom sheet. This will work like a charm!!!

android:layout_gravity="center_horizontal"

Post a Comment for "How To Tie A Bottomsheet At The Bottom View Of The Layout"