Right:
CGSize maxSize = CGSizeMake(200.0f, CGFLOAT_MAX); CGSize requiredSize = [label sizeThatFits:maxSize]; label.frame = CGRectMake(10, 10, size.width, size.height);
Right:
CGSize maxSize = CGSizeMake(200.0f, CGFLOAT_MAX); CGSize requiredSize = [label sizeThatFits:maxSize]; label.frame = CGRectMake(10, 10, size.width, size.height);
The iOS UIKit does not provide the possibility to vertically align text in an UILabel frame, however there is a solution, to align text to the top of the label. To fix the problem, visit Stackoverflow.com.