Skip to content
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

部分标签显示... #272

Open
gongjunnangithub opened this issue Jan 8, 2021 · 0 comments
Open

部分标签显示... #272

gongjunnangithub opened this issue Jan 8, 2021 · 0 comments

Comments

@gongjunnangithub
Copy link

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尺寸比计算的稍小,造成文字显示不下,显示...这种情况
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant