开发者

Make label snap to the right edge of another label

开发者 https://www.devze.com 2023-03-06 03:13 出处:网络
I have a variable length title label in my view, and i would like a second label representing a count to be immediately to it\'s right.

I have a variable length title label in my view, and i would like a second label representing a count to be immediately to it's right.

The reason I'd like to do 2 labels is that I'd like the title to be truncated past a certain length, and the count to be visible after the ellipsis.

Is t开发者_C百科his approach the right way to do this? Or should i just build a single string based on title length?

Thanks


I would just use one label and truncate the string in my code. Its just one less IBOutlet you have to deal with and it will also make it easier if you ever want to change the length of the string in the future.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号