开发者

UIToolbar in a popover

Is it possible to show toolbar items in a UIViewController inside a popover? I'm doing this in the viewDidLoad method of my view controller:

UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:nil action:nil];
    [self setToolbarItems:[NSArray arrayWi开发者_Python百科thObject:addButton]];
    [addButton release];

Then I'm wrapping this view controller in a UINavigationController (which has a toolbar property, and according to the docs, I'm supposed to use the setToolbarItems method of UIViewController to add items to the toolbar), then presenting it in a popover.

I do not see the toolbar. Are toolbars unsupported when using a popover?

Thanks


Figured it out, apparently the toolbar is hidden by default so you have to do this:

[self.navigationController setToolbarHidden:NO animated:NO];

To make it appear.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜