【发布时间】:2014-01-10 08:42:03
【问题描述】:
我正在使用OHAttributed 标签。我希望如果标签长于 3 行,则第三行以 "..." 结尾。
首先,我像这样计算了我的OHAttributedlabel的框架高度。
OHAttributedLabel *lblAppointment = [[OHAttributedLabel alloc]init];
lblAppointment.numberOfLines = 0;
lblAppointment.attributedText = atrAppointment;
[atrAppointment setFont:[UIFont fontWithName:@"MyriadPro-Regular" size:13]];
appointmentRect.size.height = [self heightForLabel:atrAppointment];
lblHeight += appointmentRect.size.height + 5;
[lblAppointment setFrame:appointmentRect];
[self addSubview:lblAppointment];
有人可以帮我吗?
【问题讨论】:
-
已设置
UILineBreakModeTailTruncation? -
当我设置它时,它只显示第一行,然后截断它的尾巴
标签: ios iphone objective-c uilabel nsattributedstring