我有一个导航控制器,我已经将两个视图推入其中。我想在导航栏中显示一个按钮,该按钮应显示在所有视图中。但是当我尝试这样...
UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
[button setBackgroundImage:[UIImage imageNamed:@"logo-57.png"] forState:UIControlStateNormal];
[button addTarget:self action:@selector(backButtonClicked) forControlEvents:UIControlEventTouchUpInside];
[button setFrame:CGRectMake(-2, 0, 57, 57)];
UIBarButtonItem *btnItem = [[UIBarButtonItem alloc] initWithCustomView:button];
root_obj_ab.navigationItem.rightBarButtonItem = btnItem;
它在我正在编写代码的本地视图中添加。如何为所有视图设置按钮?
TIA