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
{{ message }}
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
The quick fix is to use the configured arrowPosition to determine which dimension should be included, but arrowPosition is optional (.any is a valid option), and the configured arrow position is not always used.
There's no quick fix, but a workaround hack is to add content padding when using the tooltip:
// Compensate for a bug in EasyTipView which adds the height of the "arrow" to the height of the content bubble, which adds padding below the content
// In addition, and related to this, the arrow is included in the overall size of the tooltip, but not added to the overall size of the tooltip (unless it happens to be at the top or bottom, in which case the hard-coded addition of its height works in our favor).
// This is still tricky because when laying out inside of a specific superview, the arrow direction can be changed when the tooltip doesn't fit. Which means our padding hacking here will result in even worse layout problems.
letdefaultPadding:CGFloat=12
switch position {case.left:
tipPreferences.positioning.contentInsets =UIEdgeInsets(top: defaultPadding, left: defaultPadding +4, bottom: defaultPadding -4, right: defaultPadding)case.right:
tipPreferences.positioning.contentInsets =UIEdgeInsets(top: defaultPadding, left: defaultPadding, bottom: defaultPadding -4, right: defaultPadding +4)case.top:
tipPreferences.positioning.contentInsets =UIEdgeInsets(top: defaultPadding +4, left: defaultPadding, bottom: defaultPadding -4, right: defaultPadding)case.bottom:
tipPreferences.positioning.contentInsets =UIEdgeInsets(top: defaultPadding, left: defaultPadding, bottom: defaultPadding -4, right: defaultPadding +4)default:fatalError("We can't support 'any' position until that bug is fixed")}
This workaround is incompatible with .any position and will result in broken layout when the arrow position is changed because it doesn't fit (which seems to only be possible when a superview is specified).
The long-term fix could be:
Move the layout logic such as in arrange(withinSuperview:) out to the other places that need to be aware of the actual arrow position
Remove the arrow dimension from the tooltip dimensions, so the size of the bubble is the same regardless of the arrow, and then place the arrow outside of those dimensions. That would also allow a tooltip to be displayed without an arrow, which seems like a useful feature.
The text was updated successfully, but these errors were encountered:
The tooltip is designed to include the arrow within its bounds, and the height of the arrow is included in that calculation
The quick fix is to use the configured
arrowPosition
to determine which dimension should be included, butarrowPosition
is optional (.any
is a valid option), and the configured arrow position is not always used.There's no quick fix, but a workaround hack is to add content padding when using the tooltip:
This workaround is incompatible with
.any
position and will result in broken layout when the arrow position is changed because it doesn't fit (which seems to only be possible when a superview is specified).The long-term fix could be:
arrange(withinSuperview:)
out to the other places that need to be aware of the actual arrow positionThe text was updated successfully, but these errors were encountered: