Can I add an iPad popover programatically?
Is it possible to add a popover programatically witho开发者_如何学Cut using a NIB file? All the examples I have run into use NIB files.
Any information/help/examples would be appreciated.
Thanks!
Take a look at the UIPopoverController.
Init it with a content view controller (any UIViewController
subclass that shows your content), and afterwards you can show it with:
- (void)presentPopoverFromRect:(CGRect)rect inView:(UIView *)view permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated
or
- (void)presentPopoverFromBarButtonItem:(UIBarButtonItem *)item permittedArrowDirections:(UIPopoverArrowDirection)arrowDirections animated:(BOOL)animated
精彩评论