UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0,0,0,0)];
label.numberOfLines = 0;
label.backgroundColor = [UIColor clearColor];
NSDictionary *attributes = @{NSFontAttributeName:[UIFont systemFontOfSize:20],};
NSString *str = @
"你是谁"
;
CGSize textSize = [str boundingRectWithSize:CGSizeMake(100, 100) options:NSStringDrawingTruncatesLastVisibleLine attributes:attributes context:nil].size;;
[label setFrame:CGRectMake(100, 100, textSize.width, textSize.height)];
label.textColor = [UIColor greenColor];
label.text = str;
[self.view addSubview:label];