You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
But when contentEdgeInsets == .zero (which is the default) then the height = typography.lineHeight + 12.
It's as if the system then adds in content insets of {6, 0, 6, 0} (unsure of the leading/trailing values but they don't matter to this bug).
If you set the insets to have one value of 0.0000001, even if it's to leading/trailing and top + bottom are both 0, then the button will have the correct height.
This seems to be some sort of bug or behavior in UIButton and it happens on iOS 14+ (all versions we support).
This bug means that by default TypographyButton has the wrong height (12 pts too tall), which is not good.
We might have to resort to a nasty workaround like setting the insets to {0, 0.000001, 0, 0} and maybe also overriding contentEdgeInsets.didSet to intercept .zero and replace it with this alternate "almost zero" version to keep the bug from happening.
The text was updated successfully, but these errors were encountered:
The height of the typography button (ignoring images) for a single line text label should be:
But when
contentEdgeInsets == .zero
(which is the default) then the height = typography.lineHeight + 12.It's as if the system then adds in content insets of
{6, 0, 6, 0}
(unsure of the leading/trailing values but they don't matter to this bug).If you set the insets to have one value of
0.0000001
, even if it's to leading/trailing and top + bottom are both 0, then the button will have the correct height.This seems to be some sort of bug or behavior in UIButton and it happens on iOS 14+ (all versions we support).
This bug means that by default
TypographyButton
has the wrong height (12 pts too tall), which is not good.We might have to resort to a nasty workaround like setting the insets to
{0, 0.000001, 0, 0}
and maybe also overridingcontentEdgeInsets.didSet
to intercept.zero
and replace it with this alternate "almost zero" version to keep the bug from happening.The text was updated successfully, but these errors were encountered: