How to have non-sticky toolbar background in SwiftUI

4 weeks ago 33
ARTICLE AD BOX

I've taken a liking to a few particular apps that have a color/background behind their toolbar at the top of the view, as if to emphasize the navigation titles/headers, but then you can scroll past it.

I've attempted something similar with .toolbarBackground and .toolbarVisibility, trying to set it conditionally to varied results, and it's also not non-sticky, I'm just varying the opacity.

Anyone know how to do this? Example screenshots below from Slack app, before and after scrolling down. In this case, it looks like their title is also non-sticky however.

slack app before scrolling down

slack app after scrolling down

Read Entire Article