Post

Replies

Boosts

Views

Activity

Reply to UIButton trimmed text when using bold text
I've just noticed this issue myself on iOS 17, and have found that it seems to only truncate the button title when the image uses the template rendering mode. // The following causes the title to be truncated when bold text is turned on, // because the image width increases slightly setImage(myImage.withRenderingMode(.alwaysTemplate), for: .normal) // The following prevents the image size from changing when bold text is enabled setImage(myImage.withRenderingMode(.alwaysOriginal), for: .normal) Seems like an unusual bug with UIButton, but at least this fix/workaround is simpler than attempting to calculate changes to the intrinsic content size.
Mar ’24