改变ABPeoplePickerNavigationController的UINavigationBar 颜色

来源:互联网 发布:腾讯股票分红 知乎 编辑:程序博客网 时间:2024/05/22 06:38

改变这个系统的颜色其实也很简单

-(IBAction)showContacts:(id)sender{  foundSearchBar = NO;    ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];    picker.peoplePickerDelegate = self;// Display only a person's phone, email, and birthdateNSArray *displayedItems = [NSArray arrayWithObjects:[NSNumber numberWithInt:kABPersonPhoneProperty],                               [NSNumber numberWithInt:kABPersonEmailProperty],                               [NSNumber numberWithInt:kABPersonBirthdayProperty], nil];[picker setPeoplePickerDelegate:self];    picker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.94 green:0.278 blue:0.247 alpha:1.0]; picker.displayedProperties = displayedItems;// Show the picker[self presentViewController:picker animated:YES completion:nil];    [picker release];    }

 效果如下:


原创粉丝点击