标签在我的桌子细胞中 [英] label in my tabel celll
本文介绍了标签在我的桌子细胞中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
标签中的文字大小
感谢您的快速反馈
,但对我不起作用,我在表中使用标签。
thank you for your fast feedback but that not worked for me i am using labels in table..
UILabel *label1 = (UILabel *) [cell viewWithTag:1];
label1.backgroundColor = [UIColor clearColor];
label1.text=aStation.station_name;
label1.textColor = [UIColor colorWithRed:0.76 green:0.21 blue:0.07 alpha:1.0];
[label1 setFont:[UIFont fontWithName:@"Trebuchet MS" size:15]];
对于这种类型的标签,我想限制字符数。
希望我会得到答案。
for this type of label i want to limit number of characters. hope i will get an answer..
推荐答案
NSString *myString = [self getStringValue]; // Set the value any way you like.
int maxLen = 10; // Or whatever your true maximum length is.
label.text = myString;
if (([myString length] > maxLen) label.text = [myString substringToIndex:maxLen];
这篇关于标签在我的桌子细胞中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文