0

簡単な質問。TTLauncherViewControllerと組み合わせてツールバー項目を追加するにはどうすればよいですか。ツールバーが表示されるので、私は非常に基本的な間違ったことをしなければなりませんが、ボタンは表示されません:

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];
4

1 に答える 1

1

これが問題になる可能性がありますか?

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

つまり、ツールバーはナビゲーションコントローラの子ではなく、親ビューであるということです。

于 2011-02-21T19:51:42.547 に答える