Other question... How can i make a TopBar on scaff...
# compose
a
Other question... How can i make a TopBar on scaffold "floatiing" with a custom shape? I've tried adding a
clip()
modifier, but then elevation is lost
b
maybe you can use the
graphicsLayer
modifier so that you can apply clipping and elevation? Kind of like:
Copy code
modifier = Modifier
        .fillMaxWidth()
        .padding(32.dp)
        .border(width = 4.dp, color = red700, CutCornerShape(32.dp))
        .graphicsLayer {
            shadowElevation = 8.dp.toPx()
            shape = CutCornerShape(32.dp)
            clip = true
        }
Disclaimer: I’ve never used it myself, and only learned about it within the last few hours when learning about custom shapes.
a
You can draw a custom shadow to replicate the shadow you would get with elevation (https://gist.github.com/cedrickring/0497965b0658d6727aaec531f59e8c5c)