-
Notifications
You must be signed in to change notification settings - Fork 11
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
UL&S: bug fix: make the TextLinkButtonTableViewCell button word wrap, not truncate #310
Conversation
|
||
button.titleLabel?.font = UIFont.preferredFont(forTextStyle: .callout) | ||
button.titleLabel?.adjustsFontForContentSizeCategory = true | ||
button.titleLabel?.lineBreakMode = .byWordWrapping |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a thought here: since you're using a xib
, it would be nice to set these at design time, although, for a UIButton
is less obvious, since you don't have the 'adjustsFontForContentSizeCategoryreadily available. You might still set the font and line break mode in there. You could also set
adjustsFontForContentSizeCategoryin there using
@ibdesignable` (which I don't think is worth) or trying to set that value as a user defined runtime attribute (but it would still be a runtime calculation). Again it's just a thought, there's nothing wrong in leaving as it is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okie dokie, I moved setting the font and lineBreakMode to the Interface Builder. ajustsFontForContentSizeCategory
is a variable in the UIContentSizeCategoryAdjusting
protocol. Protocol variables don't seem to work with @IBInspectable or @IBDesignable, so I left it as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @Gio2018 - it'd be nice if those settings were in the xib, but not a big deal. Otherwise looks good!
Ref #283
Per #308, there is a bug where the button title text was truncating. This PR fixes the truncation.
PR to test fix: wordpress-mobile/WordPress-iOS#14385
Before:
After: