Issue
I tried the code in background color on Button in Jetpack Compose
Button(
onClick = { },
backgroundColor = Color.Yellow) {
}
but it doesn't recognize backgroundColor
anymore.
I tried the below
Button(
modifier = Modifier.background(Color.Yellow),
onClick = { }){
}
Doesn't error out but the color is not setting
I'm using 1.0.0-alpha07
of Jetpack Compose. What's the way to set background color of the button?
Solution
Try this:
Button(
onClick = {},
colors = ButtonConstants.defaultButtonColors(backgroundColor = Color.Yellow)
) {
/**/
}
Answered By - veritas1
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.