2010-08-05 123 views

回答

5

哦,我得到了答案。

ABPersonViewController *personViewController = [[ABPersonViewController alloc] init]; 
personViewController.addressBook = addr; 
personViewController.displayedPerson = ABAddressBookGetPersonWithRecordID(addr, (ABRecordID)personID); 
personViewController.allowsEditing = YES; 
personViewController.personViewDelegate = self;  
personViewController.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:NSLocalizedString(@"Return",nil) style:UIBarButtonItemStylePlain target:self action:@selector(ReturnFromPersonView)]; 
+0

單擊編輯按鈕後,backBarButton將消失。 – 2013-04-19 01:06:53

0

爲Variant:

ABPersonViewController *personView = [[ABPersonViewController alloc] init]; 
[self.navigationController pushViewController:personView animated:YES]; 
personView.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"return" style:UIBarButtonItemStyleBordered target:self action:@selector(action:)]; 
+0

謝謝。但是,如果ABPersonViewController是導航控制器的初始視圖,也就是說,導航控制器的堆棧中沒有更多視圖,然後如何返回之前的視圖,該視圖不包含導航欄。 – pcjbird 2010-08-06 00:26:52