tipsywacky
tipsywacky

Reputation: 3464

iPad: Popover windows got resized iOS

CGRect rect = CGRectMake(0, 0, 1050, 900);

[wineAdminPopup presentPopoverFromRect:rect inView:master.view permittedArrowDirections:UIPopoverArrowDirectionUp animated:YES];

Hi I put the above code to make a popup in a tableview. However it doesn't popup in the whole screen. If I want to center it in the iPad screen with no arrow or arrow in the center. How can i do it. Thanks in advance.

Upvotes: 0

Views: 482

Answers (2)

Garnik
Garnik

Reputation: 423

presentModalViewController is deprecated in iOS 6 and above. Use presentViewController:yourViewController animated:YES completion:nil (parameters animated and completion can be set depending on your requirements). Also if you want to resize yourViewController you need to change self.view.frame and next time your view controller will be of that size.

Upvotes: 0

Martin R
Martin R

Reputation: 539685

The rect parameter in presentPopoverFromRect:... specifies the rectangle at which to anchor the popover, not the size of the presented popover. That would be specified by setting contentSizeForViewInPopover on the popover's content view controller.

If you don't want the arrows and don't need the specific behavior of popovers, then you could present your view controller modally:

controller.modalPresentationStyle = UIModalPresentationFullScreen; // or UIModalPresentationFormSheet
[self.navigationController presentModalViewController:controller animated:YES];

Upvotes: 1

Related Questions