I am upgrading my app from iOS6 to iOS7 and I am having some issues with my UIViewControllers layout. In iOS6 I was able to resize my UITextViews dynamically by getting the contentSize property of the textView and then setting its frame property. I would do all the resizing in the viewWillAppear method so that way the view would be resized before it was visible. Now in iOS7 it doesn't work. The only way the contentSize property works is if I set in the viewDidAppear method. I hate doing that because it causes the view to jump after it's already visible. Has anyone figured out how to solve this problem?
Here is my code that no longer works in iOS7:
-(void)viewWillAppear:(BOOL)animated
{
self.textView = [[UITextView alloc]initWithFrame:CGRectMake(5, 0, 310, 0)];
self.textView.text = @"Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.";
[self.view addSubview:self.textView];
CGRect textViewframe;
textViewframe = self.textView.frame;
textViewframe.size.height = [self.textView contentSize].height;
self.textView.frame = textViewframe;
}