【发布时间】:2010-09-01 14:13:58
【问题描述】:
我很想在ABPeoplePickerNavigationController 中自定义颜色,下面是我的完整代码:
ABPeoplePickerNavigationController *objPeoplePicker = [[ABPeoplePickerNavigationController alloc] init];
[objPeoplePicker setPeoplePickerDelegate:self];
objPeoplePicker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];
objPeoplePicker.topViewController.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];
[self presentModalViewController:objPeoplePicker animated:YES];
自定义 NavigationBar tintColor,此行有效:
objPeoplePicker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];
但是,我还想自定义 searchBar 的 tintColor:
objPeoplePicker.topViewController.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];
那条线不起作用。我想我可能引用了错误的 searchBar....你能指出我正确的方向吗?
【问题讨论】:
标签: iphone objective-c uiviewcontroller uisearchbar tintcolor