/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// resize description label to fit text.. UIFont* font = descriptionLabel.font; CGSize constraintSize = CGSizeMake(descriptionLabel.frame.size.width, MAXFLOAT); CGSize labelSize = [descriptionLabel.text sizeWithFont:font constrainedToSize:constraintSize lineBreakMode:UILineBreakModeWordWrap]; descriptionLabel.frame = CGRectMake(descriptionLabel.frame.origin.x, descriptionLabel.frame.origin.y, descriptionLabel.frame.size.width, labelSize.height); // if the label's in a UIScrollView, and the label is at the bottom, here's how // to make it scroll correctly. // make the size of the scroll view be the distance from the top to the bottom of the // description label. scrollView.contentSize = CGSizeMake(scrollView.contentSize.width, descriptionLabel.frame.origin.y + descriptionLabel.frame.size.height);