-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Button's title font set in Storyboard/IB will be discarded #1230
Comments
Hmm, If we add I think we may check if font is set by user by comparing current one with default one: let defaultButtonFont = UIFont.systemFont(ofSize: UIFont.buttonFontSize)
if titleLabel?.font == defaultButtonFont {
titleLabel?.font = Theme.font.regular(with: fontSize)
} @mohpor Can you please try above code and see if it works for you? |
Then it must be something else that is triggering the font update. I have a rather large project that has many many I already have a workaround, but due to the vast amount of revision and coding effort, I had to revert back to
this is what has happened to me unfortunately. |
Ahh, I am mistaken. The line was added by me in cf36b57 It was not there before. |
The reason why I added it, I believe, was that @DanielDahan had been changing font to |
btw, thank you for reporting this @mohpor 💪 |
Hi @mohpor please find the latest release with the above fixes here https://github.com/CosmicMind/Material/releases/tag/3.1.1. |
Hi,
Material 3.x (and Theming to be more specific), discards font's set on
Button
s in IB.this line will override the button's font, regardless of you opting out of theming.
I guess it should check to see if Theming (globally) is enabled before changing values.
e.g.:
For now, the workaround is to set button's font in code.
The text was updated successfully, but these errors were encountered: