如何将自定义栏按钮项目添加到 AddressBookUI 应用程序中的导航栏,例如编辑代替取消
我不明白为什么导航栏不会在以下代码中添加除取消按钮之外的任何按钮 这种事情是在 Viber 应用程序中完成的,因此
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.navigationBar.tintColor=[UIColor colorWithRed:91.0/256.0 green:72.0/256.0 blue:110.0/256.0 alpha:1.0];
//picker.navigationController.navigationBar.topItem.rightBarButtonItem = nil;
[picker.navigationBar setHidden:NO];
picker.peoplePickerDelegate = self;
// Display only a person's phone, email, and birthdate
NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty],
[NSNumber numberWithInt:kABPersonEmailProperty],
[NSNumber numberWithInt:kABPersonBirthdayProperty], nil];
//picker.navigationBarHidden=TRUE;
picker.displayedProperties = displayedItems;
//UIBarButtonItem *addbutton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(AddContact)];
// picker.navigationController.navigationBar.topItem.rightBarButtonItem = addbutton;
[self presentModalViewController:picker animated:NO];
[picker release];
//[addbutton release];
任何人都可以帮忙
I can not understand why navigation bar is not going to add any button other than cancel button in Following code
this kind of thing done in Viber application so it is possible
ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
picker.navigationBar.tintColor=[UIColor colorWithRed:91.0/256.0 green:72.0/256.0 blue:110.0/256.0 alpha:1.0];
//picker.navigationController.navigationBar.topItem.rightBarButtonItem = nil;
[picker.navigationBar setHidden:NO];
picker.peoplePickerDelegate = self;
// Display only a person's phone, email, and birthdate
NSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty],
[NSNumber numberWithInt:kABPersonEmailProperty],
[NSNumber numberWithInt:kABPersonBirthdayProperty], nil];
//picker.navigationBarHidden=TRUE;
picker.displayedProperties = displayedItems;
//UIBarButtonItem *addbutton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(AddContact)];
// picker.navigationController.navigationBar.topItem.rightBarButtonItem = addbutton;
[self presentModalViewController:picker animated:NO];
[picker release];
//[addbutton release];
can anybody help please
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅这篇文章,它演示了如何添加
ABPeoplePickerNavigationController
上的自定义按钮refer this article it demonstrates how to add custom button on
ABPeoplePickerNavigationController
我可以向您展示如何向导航栏添加自定义按钮。如果有帮助,请使用此代码,
i can show you how to add custom button to navigation bar. Use this code if this is helpful,