问题
Possible Duplicate:
text size in label
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..
回答1:
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];
来源:https://stackoverflow.com/questions/3048339/label-in-my-tabel-celll