We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
override open var intrinsicContentSize: CGSize { var size = titleLabel?.text?.size(withAttributes: [NSAttributedString.Key.font: textFont]) ?? CGSize.zero size.height = textFont.pointSize + paddingY * 2 size.width += paddingX * 2 if size.width < size.height { size.width = size.height } if enableRemoveButton { size.width += removeButtonIconSize + paddingX } return size }
size.width += paddingX * 2 tagView的宽度计算建议留一定的余量 size.width +=( paddingX + 1 )* 2 ,某些情况如果paddingX为12.48这种非整数的时候,由于像素不对齐问题,会造成titleLabel尺寸比计算的稍小,造成文字显示不下,显示...这种情况
The text was updated successfully, but these errors were encountered:
No branches or pull requests
override open var intrinsicContentSize: CGSize {
var size = titleLabel?.text?.size(withAttributes: [NSAttributedString.Key.font: textFont]) ?? CGSize.zero
size.height = textFont.pointSize + paddingY * 2
size.width += paddingX * 2
if size.width < size.height {
size.width = size.height
}
if enableRemoveButton {
size.width += removeButtonIconSize + paddingX
}
return size
}
The text was updated successfully, but these errors were encountered: