Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to open a second UIPopOverController over first popover button click

Is it possible to open another uipopovercontroller from the first popover UIButton click? If yes then how can i do it?

right now i am using the given code to open a popover from UIBarButtonItem

optionsViewController = [[OptionsViewController alloc] init];

popOverController = [[UIPopoverController alloc] initWithContentViewController:optionsViewController];

popOverController.popoverContentSize = CGSizeMake(250, 300);
[popOverController presentPopoverFromBarButtonItem:bbiOpenPopOver permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
like image 627
Meeya Avatar asked Dec 09 '25 15:12

Meeya


1 Answers

You can open a second popover from any control in a popover; the mechanism is exactly the same as opening the first one. You need a reference to the content view controller, you create a new UIPopoverController using [[UIPopoverController alloc] initWithContentViewController:content];, you set whatever properties you want and then you present it.

To present it from a UIButton or other control that isn't a UIBarButtonItem use

[popoverController presentPopoverFromRect:[control bounds] inView:control permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
like image 152
Phil Willoughby Avatar answered Dec 12 '25 23:12

Phil Willoughby



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!