0

嗨,在我的 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 中有默认按钮。我怎样才能解决这个问题?

4

1 回答 1

0

我认为这是因为您topViewControllernavigationControllernil,您可能需要将初始化的 VC 作为 rootViewController 设置为您的peopleNavigationController.

于 2013-10-17T10:33:29.180 回答