1

I have tried for a few hours without success to remove the top padding from the Compose ModalBottomSheetLayout.

I tried debugging through the internal material classes to trace where the padding is being set and can't for the life of me work it out!

I want to add a background image which completely fills the ModalBottomSheetLayout right up to and including the rounded corners but clipped by them. Even if I remove the rounded corners (see pic) the issue remains with the extra padding above the sheetContent.

I have added an image with some background colors showing the issue. The blue bar is the top (extra unknown padding) of the bottom sheet opened at HalfExpanded state.

enter image description here

Another example with the rounded corners:

enter image description here

Paul Frank Allan
  • 579
  • 4
  • 13
  • 1
    Is there a reason you aren't using the `sheetBackgroundColor` value on `ModalBottomSheetLayout`? Then both would be the same color. – ianhanniballake Oct 04 '22 at 02:05
  • Yes @ianhanniballake I was just using the colors to figure out where the padding is coming from and to show it here more clearly. What I really want is to fill the sheet background completely with an image and remove the padding. Since writing the post I found a workaround by making the sheet color transparent and putting a rounded corner shape on the content. It's not nice and the padding is still there but it's all I've got so far :( Thanks – Paul Frank Allan Oct 04 '22 at 07:27
  • @ianhanniballake Being able to set this value would be nice. It would allow implementing [a drag handle as demonstrated in the material design guideline](https://m3.material.io/components/bottom-sheets/specs). The drag handle sits too low otherwise. – SVP Nov 23 '22 at 06:43

0 Answers0