On detailview (Scrollview) in my app I have a UILabel that gets text that will have about 1000 words.
I want to resize it so the label fits - works fine so far
-(void) viewDidAppear:(BOOL)animated {
NSString *message = storycontent.text;
CGSize maximumLabelSize = CGSizeMake(280,5000);
CGSize expectedLabelSize = [message sizeWithFont:storycontent.font constrainedToSize:maximumLabelSize lineBreakMode:NSLineBreakByWordWrapping];
CGRect newFrame = storycontent.frame;
newFrame.size.height = expectedLabelSize.height;
storycontent.frame = newFrame;
}
When navigation to that detailview the label is resized as expected. Now the weird thing: The moment I want to scroll down the UILabel snaps back to the initial size, so that only the first words are visible.
What can I do to avoid that behavior?
UPDATE: When i delete the label and put in a new one it works fine. The strange behavior starts the moment i change the font size to something other then 17.