Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To change the background color of a button in Jetpack Compose, you can use the 'backgroundColor' modifier. Here's an example:

Button(
    onClick = { /* Do something! */ },
    modifier = Modifier
        .background(color = Color.Green) // Set the background color
) {
    Text("Click me!")
}

In this example, the button will have a green background color. You can change the color value to any other color you like.