首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >ABPersonViewController没有显示facetime按钮吗?

ABPersonViewController没有显示facetime按钮吗?
EN

Stack Overflow用户
提问于 2013-11-25 15:18:47
回答 1查看 387关注 0票数 0

我使用ABPeoplePickerNavigationController获取联系人,当我选择这些联系人中的任何一个时,我都会使用ABPersonViewController获取该联系人的详细信息。从苹果文档中,我们将使用allowsActions:方法获得ABPersonViewController上的face time button。但是我没有得到面对面的时间。我使用了以下代码..

代码语言:javascript
复制
- (BOOL)peoplePickerNavigationController: 
(ABPeoplePickerNavigationController *)peoplePicker 
shouldContinueAfterSelectingPerson:(ABRecordRef)person { 
// NSLog(@"shouldContinueAfterSelectingPerson"); 
ABPersonViewController *picker = [[ABPersonViewController alloc] init] ; 
picker.personViewDelegate = self; 
picker.displayedPerson = person; 
picker.displayedProperties=@[@(kABPersonPhoneProperty),@(kABPersonEmailProperty),@(kABPersonBirthdayProperty),@(kABPersonOrganizationProperty),@(kABPersonJobTitleProperty),@(kABPersonDepartmentProperty),@(kABPersonNoteProperty),@(kABPersonCreationDateProperty)]; 
picker.allowsActions=YES; 
[self.navigationController pushViewController:picker animated:YES];}
EN

回答 1

Stack Overflow用户

发布于 2013-11-25 17:49:56

我有答案了。我使用了[self.navigationController pushViewController:picker animated:YES]而不是[peoplePicker pushViewController:picker animated:YES]。这就是为什么我没有得到我想要的。原因是,当我写[self.navigationController pushViewController:picker animated:YES]时,默认的ABPersonViewController会是come。所以facetime,shareContact和添加到收藏夹的按钮都不存在。但是当我编写[peoplePicker pushViewController:picker animated:YES]时,创建了自定义方法,并且所有的按钮都使用allowsActions:ABPersonViewController

代码语言:javascript
复制
 - (BOOL)peoplePickerNavigationController:
    (ABPeoplePickerNavigationController *)peoplePicker
          shouldContinueAfterSelectingPerson:(ABRecordRef)person {

                ABPersonViewController *picker = [[ABPersonViewController alloc] init];
                picker.personViewDelegate = self;
                picker.displayedPerson = person;
                picker.displayedProperties = peoplePicker.displayedProperties;
                picker.allowsActions = YES;
               [peoplePicker pushViewController:picker animated:YES];
           return NO;
    }
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/20186740

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档