My app uses a snackbar of material-components-ios. I want to change BackgroundColor
to blue, but I can't.
So is it possible to change the background color of snackbar?
You don't have to hack it :-)
Since you have added the swift
tag to this question, then I'll give an answer with Swift code.
MDCSnackbarMessageView.appearance().snackbarMessageViewBackgroundColor = .green
MDCSnackbarManager.show(MDCSnackbarMessage(text: "Hi there"))
I'm using MaterialComponents version 68.1. If you too, try this:
let message = MDCSnackbarMessage()
message.text = "message"
MDCSnackbarManager.messageTextColor = .white
MDCSnackbarManager.snackbarMessageViewBackgroundColor = .blue
MDCSnackbarManager.show(message)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With