2013-10-17 77 views
0

嗨在我的iPhone應用程序中,我需要在ABPeoplePickerNavigationController中設置barButtonItems。在iOS 6工作正常:在ABPeoplePickerNavigationController中添加barButtonItems在ios 7中

-(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

我想這是因爲你的navigationControllertopViewController,你可能需要設置初始化的VC作爲RootViewController的你peopleNavigationController

相關問題