IPad UIPopoverController How to Set Header

I have a UIPopoverController that displays a table. I am using the PresentFromBarButtonItem method.

How can I show a pop-up name to display, much from a UISpliter list?

+4
source share
2 answers

1. Set the header parameter to UITableViewController ;

2. Add a UITableViewController to the UINavigationController .

 @interface YourTableViewController : UITableViewController < ... > ... @end 

...

...

 YourTableViewController *vc = [[YourTableViewController alloc] init... ; vc.title = @"Some Title"; // add vc to an UINavigationController then forget it. UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:vc]; [vc release]; UIPopoverController *some_pvc = [[UIPopoverController alloc] initWithContentViewController:nav]; [nav release]; 

Then show UIPopoverController some_pvc by sending a message presentPopoverFromRect: ... to UIViewController , you will see a title bar

alt text

+25
source

I donโ€™t know what you mean by UISpliter, but you need to wrap your view controller in a UINavigationController and show the navigation controller in a popover. The title property of the controller of your view will appear above the view controller view.

+2
source

Source: https://habr.com/ru/post/1332311/


All Articles