标签中的文字大小 [英] text size in label
本文介绍了标签中的文字大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何限制标签中的字符数
how can i limit the number of characters in a label
推荐答案
您可以通过设置UILabel
的frame
来自动用省略号截断文本.
You can truncate the text with an ellipsis automatically by setting the frame
of the UILabel
.
NSInteger newSize = 10;
label.frame = CGRectMake(label.frame.origin.x, label.frame.origin.y, label.frame.size.height, newSize);
这篇关于标签中的文字大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文