我在我的UIView中添加了一个UINavigationBar
我正在尝试设置它的标题,但它的左栏byut失败了
我使用以下代码
self.title = @"Edit Table ";
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(EditTable:)];
[self.navigationItem setLeftBarButtonItem:addButton];
[super viewDidLoad];不做任何更改,我使用以下命令调用此uiview
self.NodeSelection = [[NodesList alloc]initWithNibName:@"NodesList" bundle:nil];
[self presentModalViewController:self.NodeSelection animated:YES];有什么建议请提
发布于 2011-06-08 15:39:01
更新
使用以下命令调用此视图
[self.navigationController pushViewController:self.NodeSelection animated:YES];您可以使用以下命令更改NavigationBar的标题
self.navigationItem.title = @"Hello";对于leftBarButton,您的代码是正确的。
第二次更新
返回父屏幕
[self.navigationController popViewControllerAnimated:YES];发布于 2011-06-08 15:45:28
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStylePlain target:self action:@selector(EditTable:)];
[self.navigationItem setLeftBarButtonItem:addButton];
[addButton release];https://stackoverflow.com/questions/6275508
复制相似问题