I want to add a UIViewController on my current UIView on a button click event. But I am not able to set the frame. How can I set the y-axis of view. I also checked out
iPhone: How to set UIViewController frame? but I can’t solve it.
GalleryViewController *objgallery = [[GalleryViewController
alloc]initWithNibName:@"GalleryViewController" bundle:[NSBundle mainBundle]];
objgallery.view.frame = CGRectMake(0, 88, 320, 372);
[self presentModalViewController:objgallery animated:YES];
If you are trying to present a modal view that is smaller than the screen, I fear that this is not the way
presentModalViewControllerworks. It will always try and enforce its own animation/geometry.The only way you have to go that I can think of, is creating your own (non-modal) view and then animate it to the position you like. Something along the lines of: