//Calculate the size necessary for the UILable
NSString *theText = @"Texting";
CGSize theStringSize = [theText sizeWithFont:font
constrainedToSize:theLabel.frame.size
lineBreakMode:theLabel.lineBreakMode];
//Adjust the size of the UILable
theLable.frame = CGRectMake(theLable.frame.origin.x,
theLable.frame.origin.y,
theStringSize.width, theStringSize.height);
theLable.text = theText;
UILable 自适应长度
最新推荐文章于 2018-02-10 20:31:18 发布