How to set background color for DynamicIslandExpandedRegion(.bottom)?

109 Views Asked by At

I want to set a background color to the bottom area of the expanded Dynamic Island. Like how Flighty does it. How can I do this?

Flighty dynamic island

I am pretty new to SwiftUI and I can't find anything online that can help me.

1

There are 1 best solutions below

1
On

DynamicIslandExpandedRegion takes a View in its content closure, so you could simply do it like this:

DynamicIslandExpandedRegion(.bottom) {
    Text("Example")
        .padding()
        .background(Color.green)
}