[英]How to handle Storyboard ViewControllers in iOS?
ADD THIS TO YOUR CODE:
CGSize maximumLabelSize = CGSizeMake(296, FLT_MAX);
CGSize expectedLabelSize = [yourString sizeWithFont:yourLabel.font constrainedToSize:maximumLabelSize lineBreakMode:yourLabel.lineBreakMode];
CGRect newFrame = yourLabel.frame;
newFrame.size.height = expectedLabelSize.height;
yourLabel.frame = newFrame;
ADD this CODE添加此代码
[yourlabel sizeToFit ]; [你的标签 sizeToFit ]; or [yourView sizeToFit];
或 [yourView sizeToFit];
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.