MDCSnackbarManager buttonFont not working

248 Views Asked by At

I am currently using Material IO Components to create a snackbar needed for the app I'm working on, and it's got everything I need except for one little thing: I need to be able to change the font of the action button, but using the attributes provided in the documentation doesn't work.

In the MDCSnackbarManager there is a buttonFont attribute, but that doesn't work (the messageFont works just fine though)

There is also a buttonFont attribute inside the MDCSnackbarMessageView but that doesn't work either.

The code that I've tried so far are these (with the messageFont being the only working one among the three)

MDCSnackbarManager.messageFont = UIFont(name: "Lato-Bold", size: 18)
MDCSnackbarManager.buttonFont = UIFont(name: "Lato-Bold", size: 13)
MDCSnackbarMessageView.appearance().buttonFont = UIFont(name: "Lato-Bold", size: 13)

Any suggestions or solutions on how to fix this is greatly appreciated!

1

There are 1 best solutions below

0
On BEST ANSWER

I tried and buttonFont works normally with below code

MDCSnackbarManager.buttonFont = UIFont.boldSystemFont(ofSize: 30)

enter image description here