您好,在我的iPhone应用程序中,我需要在ABPeoplePickerNavigationController中设置barButtonItems。在ios 6中它运行良好:
-(void) manageContacts
{
peopleNavigationController = [[PeoplePickerNavigationController alloc] init];
peopleNavigationController.peoplePickerDelegate = self;
[peopleNavigationController.navigationBar setBarStyle:UIBarStyleBlack];
peopleNavigationController.delegate = self;
peopleNavigationController.topViewController.navigationItem.leftBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"back",nil)
style:UIBarButtonItemStyleBordered
target:self
action:@selector(pressBack)];
peopleNavigationController.topViewController.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addPerson)];
[self.navigationController presentModalViewController:peopleNavigationController animated:YES];
}
但在ios 7中有默认按钮。我该如何解决这个问题?
答案 0 :(得分:0)
我认为这是因为topViewController
的{{1}} nil ,您可能需要将初始化的VC设置为navigationController
的rootViewController。