I'm using dismissModalViewControllerAnimated to dismiss my MFMailComposeViewControlle开发者_运维百科r. The problem I'm having is that the view behind the mail view gets shifted down a bit when it comes back into view.
I haven't been able to figure out why this is happening, any thoughts?
After I call dismissModalViewControllerAnimated I grab my view's frame and set the origin back to (0,0)
It works but this seems silly to have to do so if anyone comes up with a better answer I'll accept it or if I figure something better out I'll edit this.
I was having the same issue.
I found out that it was caused by the way I initially sized the view of the parent of the modal viewcontroller.
I was using [UIScreen mainScreen].bounds
This is now what is working for me:
// loadView method of the parent of the modal view controller
- (void)loadView {
CGRect frame = [UIScreen mainScreen].applicationFrame;
self.view = [[[UIView alloc] initWithFrame:frame] autorelease];
[self.view setAutoresizingMask:UIViewAutoresizingFlexibleHeight|UIViewAutoresizingFlexibleWidth];
// Below is the actual code with the content of the view
[...]
}
精彩评论