0

I have a View Controller that I present modally using the following code :

about.modalPresentationStyle = UIModalPresentationFormSheet;             
[self presentModalViewController:about animated:NO];

about.view.superview.frame = CGRectMake( about.view.superview.frame.origin.x+110,
                                         about.view.superview.frame.origin.y-0,
                                         320.0f,
                                         460.0f
                                        );

Now, If I present another view controller modally using the same code and similar size, everything works fine.

However, if I present a view controller modally that has the full screen size then, if I hit back (dismiss the last View Controller), the original View Controller will increase in size. The increases size is the regular size of UIModalPresentationFormSheet.

In other words: present ViewController A modally as mentioned above, then present another ViewController B from ViewController A modally. Now if B is full screen and we close it to go back to ViewController A, A will now be resized to the default frame size. I am not sure how to fix this issue. Can anyone kindly suggest a solution?

Chimera
  • 5,884
  • 7
  • 49
  • 81
Ahsan
  • 2,964
  • 11
  • 53
  • 96
  • I'm not sure Why do you move the superview of the modal view. But it seem you use the code above to present B in A? Thus, A will be B's superview and its size will be set to 320, 460. I guess that is the reason for A's resizing. – Selkie Jul 16 '12 at 03:35
  • @Selkie : the decision to act on the superview of the modal view was based on http://stackoverflow.com/questions/2457947/how-to-resize-a-uipresentationformsheet/4271364#4271364 (you need to do this in order to change the frame of a Modal VC with PresentationFormSheet. – Ahsan Jul 16 '12 at 05:47
  • @Selkie : Also, I am resizing to (320,460), why would it go to something liek (560,650) (not exact values). – Ahsan Jul 16 '12 at 13:57

0 Answers0