How to change the position of the controller view Modal View

How to change the position of the controller view Modal View?

By default, it is located in the center of the screen, I would like to compensate for the position of the form sheet so that when the keyboard is displayed it does not overlap the form window.

Is it possible?

+5
source share
2 answers

If you use a UIViewController and present it using presentModalViewController, you must accept the default behavior for the type (form) you specify. Every time he is going to visit the square in the center. So how you do it, this is not possible.

, ( , / , ), .

, , subview, , .

, .

+3

. - :

CGRect frame = self.parentViewController.view.frame;
frame.origin.x -= 50;
frame.origin.y -= 50;
self.parentViewController.view.frame = frame;

(-50, -50)

+7

All Articles