I have a Scaffold TopBar element, and containerColor is primary color. When I set my action to be TextButton, that button has same primary color as TopBar container. How do I approach this so my TextButton has actually different traits (text and ripple effect to be onPrimary color)?
p
PHondogo
12/01/2022, 3:12 PM
Try to play with this code:
Copy code
MaterialTheme(colors = Colors(onSurface=MaterialTheme.colors.onPrimary)) {
//content inside you bar
}
k
K Merle
12/01/2022, 3:57 PM
That's a nice trick. I wonder if my problem is a bug, because, when I set TopBar content color to be white, button color is not being overwritten.