I have upped my app to target api 35 and edge to e...
# compose
u
I have upped my app to target api 35 and edge to edge is enabled. However within:
Copy code
Scaffold(topBar = { CenterAlignedTopAppBar() })
how do I get the scrolling content to go behind the topbar and make the bar transclucent ? at the moment the topBar stays white and doesn't look edge to edge.
l
Try setting window insets on scaffold to 0
🙌 1
u
thanks, worked a charm. How do I make the status bar transparent so the content scrolls behind it ?
l
hmmm edg eto edge should fix that
u
do I need to add enableEdgeToEdge() ?
l
yes of course. and set correct color of the icons. I'd recommend checking out the documentation
u
I was a bit confused as I thought there was no need for that since sdk35 enforces it anyway ?
l
you still want to specify it
u
yep, that seems to have helped. Weirdly, the status bar has a 50% inset - so half is transparant, the other half is white - any thoughts on what that may be ?
l
Nope, but feel free to experiment with it
u
okay fixed that. It was some padding on the surface - Is it possible to set a 50% opacity on the status bar background when scrolling ?
l
Yes although I'd recommend playing around drawing something there instead of calling system API to modify colors. Since now you have edge-to-edge, you can draw anywhere on the screen, so feel free to have some fun with that 🙂
✅ 1