开发者

iPad UIPopoverController How to Set the Title

I have a UIPopoverController which displays a table. I use the PresentFromBarButtonItem method.

How can I give the pop up a title to display, much list the UISpli开发者_运维技巧ter does?


1. Set title parameter of your UITableViewController;

2. Add your UITableViewController to an 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 the UIPopoverController some_pvc by sending presentPopoverFromRect: ... message to an UIViewController you will see the title bar

iPad UIPopoverController How to Set the Title


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. Your view controller's title property will appear above the view controller's view.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜