我在UIView上添加了一个UINavigationBar
我正在尝试设置它的标题,而它的左侧栏标记失败
我使用以下代码
self.title = @"Edit Table ";
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStyleBordered target:self action:@selector(EditTable:)];
[self.navigationItem setLeftBarButtonItem:addButton];
[super viewDidLoad];
没有任何改变,我使用
称之为uiviewself.NodeSelection = [[NodesList alloc]initWithNibName:@"NodesList" bundle:nil];
[self presentModalViewController:self.NodeSelection animated:YES];
请提出任何建议
答案 0 :(得分:2)
<强>更新强>
使用
调用此视图[self.navigationController pushViewController:self.NodeSelection animated:YES];
您可以使用此
更改NavigationBar的标题self.navigationItem.title = @"Hello";
并且对于leftBarButton,您的代码是正确的。
第二次更新
返回父屏幕
[self.navigationController popViewControllerAnimated:YES];
答案 1 :(得分:0)
UIBarButtonItem *addButton = [[UIBarButtonItem alloc] initWithTitle:@"Edit" style:UIBarButtonItemStylePlain target:self action:@selector(EditTable:)];
[self.navigationItem setLeftBarButtonItem:addButton];
[addButton release];