0

我从现在继承UINavigationController我想设置一个按钮和我的标题ViewDidLoad

- (void)viewDidLoad
{
    [super viewDidLoad];
    self.toolbar.barStyle = UIBarStyleBlackOpaque;
    self.navigationBar.barStyle = UIBarStyleBlackOpaque;

    [self.navigationItem setTitle:@"TEST"];

    [self setToolbarHidden:YES];
}

但我不工作,我认为这是我想念的东西。

4

1 回答 1

1

For set title of UINavigationBar

use

self.title = @"TESTING";

and BarButton on NavigationBar

self.navigationItem.rightBarButtonItem = [[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(showActionsheet)] autorelease];
于 2013-04-11T08:19:39.593 回答