iPhone - 像短信联系人视图一样查看
我正在尝试在 iPhone 消息(SMS)应用程序中实现类似于联系人视图的视图。 在iPhone上撰写消息时,会有“+”按钮用于添加联系人。单击“+”时,它将显示联系人列表,只需选择一个联系人,就会在“收件人”文本字段中添加联系人姓名。 我找到以下代码来显示联系人。但是,单击联系人后,它会显示有关该联系人的更多详细信息,但只是未选中。
ABPeoplePickerNavigationController* picker;
picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
CGRect newFrame = picker.view.frame;
newFrame.size.height = newFrame.size.height - 49;
picker.view.frame = newFrame;
[self presentModalViewController:picker animated:NO];
[picker release];
有人可以指出我选择联系人的正确方法吗?
I'm trying to implement a view similar to contacts view in iPhone Message (SMS) app.
When composing a message on iPhone, there will be "+" button to add contacts. On click of "+", it will show list of contacts and just by selecting a contact, it will add the contact name in "To" text field.
I found following code to show contacts. But on click of a contact, its showing more details about the contact and just not selected.
ABPeoplePickerNavigationController* picker;
picker = [[ABPeoplePickerNavigationController alloc] init];
picker.peoplePickerDelegate = self;
CGRect newFrame = picker.view.frame;
newFrame.size.height = newFrame.size.height - 49;
picker.view.frame = newFrame;
[self presentModalViewController:picker animated:NO];
[picker release];
Can some body point out me correct way to select a contact?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我找到了解决方案。
我必须实现委托方法来处理这个问题。
以下是委托方法
}
{
。
。
。
。
[自我解雇ModalViewControllerAnimated:是];
}
{
返回否;
}
I found the solution.
I've to implement the delegate methods to handle that.
The following are the delegate methods
}
{
.
.
.
.
[self dismissModalViewControllerAnimated:YES];
}
{
return NO;
}