开发者

Buttons don't appear on the toolbar

开发者 https://www.devze.com 2023-02-12 05:00 出处:网络
A simple question. How do I add toolbar items in combination with a TTLauncherViewController. I mus开发者_如何学Got do something very basic wrong, as the toolbar appears, but the button does not show:

A simple question. How do I add toolbar items in combination with a TTLauncherViewController. I mus开发者_如何学Got do something very basic wrong, as the toolbar appears, but the button does not show:

self.navigationController.toolbarHidden = NO;
self.navigationController.toolbar.tintColor = [UIColor blackColor];

UIBarButtonItem *updateBttn = [[UIBarButtonItem alloc]
                               initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh
                               target:self
                               action:@selector(updateData:)];


UIBarButtonItem *btnSpacer = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemFixedSpace target:nil action:nil ];

self.navigationController.toolbarItems = [NSArray arrayWithObjects:updateBttn, btnSpacer, nil];

[btnSpacer release];
[updateBttn release];


Could this be the issue?

http://www.iphonedevsdk.com/forum/iphone-sdk-development/22180-navigationcontroller-toolbar-wont-show-any-buttons.html

In short, it says that the toolbar is not a child of the navigation controller but the parent view.

0

精彩评论

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