How to calculate the Width and Height of NSString on UILabel
问题 I am working on a project to make the NSString on UILabel Width and Height dynamically. I tried with: NSString *text = [messageInfo objectForKey:@"compiled"]; writerNameLabel.numberOfLines = 0; writerNameLabel.textAlignment = UITextAlignmentRight; writerNameLabel.backgroundColor = [UIColor clearColor]; CGSize constraint = CGSizeMake(296,9999); CGSize size = [text sizeWithFont:[UIFont systemFontOfSize:FONT_SIZE] constrainedToSize:constraint lineBreakMode:UILineBreakModeWordWrap]; NSLog(@