呈現在人們的iOS 7推ABPersonViewController到的ABPeoplePickerNavigationController iOS8上
- (BOOL)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker shouldContinueAfterSelectingPerson:(ABRecordRef)person {
ABPersonViewController *personViewController = [[ABPersonViewController alloc] init];
personViewController.displayedPerson = person;
[peoplePicker pushViewController:personViewController animated:YES];
return NO;
}
到目前爲止好選取器
ABPeoplePickerNavigationController *peoplePicker = [[ABPeoplePickerNavigationController alloc] init];
peoplePicker.allowsActions = YES;
peoplePicker.allowsEditing = NO;
peoplePicker.peoplePickerDelegate = self;
[self presentViewController:peoplePicker animated:YES completion:nil];
實施ABPeoplePickerNavigationControllerDelegate。人員視圖控制器按預期呈現。 iOS7方法返回值 - 可以返回否以確保人員選取器保持打開狀態。在iOS8上上述委託方法已被廢棄和新方法必須實現:
- (void)peoplePickerNavigationController:(ABPeoplePickerNavigationController *)peoplePicker didSelectPerson:(ABRecordRef)person {
ABPersonViewController *personViewController = [[ABPersonViewController alloc] init];
personViewController.displayedPerson = person;
[peoplePicker pushViewController:personViewController animated:YES];
}
的人視圖控制器被推向人選擇器,但第二人拾取器的一小部分後駁回(與人視圖一起控制器)。
有沒有辦法阻止人們在iOS8上解僱人員?還有其他建議嗎?
你在做什麼總是錯的。將ABPersonViewController推到ABPeoplePickerNavigationController上是不正確的。重新思考你的界面。 – matt 2014-10-30 20:12:03
基本上,你想達到什麼目的?爲什麼不讓人們選擇器向你展示這個人呢? – Rob 2014-10-30 20:46:38
@Rob我希望ABPersonViewController顯示默認情況下不顯示的操作按鈕。 – mrvincenzo 2014-10-30 20:49:32