Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4333338
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:22:48+00:00 2026-05-21T10:22:48+00:00

I am tyring to customize the colors a bit in a ABPeoplePickerNavigationController below is

  • 0

I am tyring to customize the colors a bit in a ABPeoplePickerNavigationController below is my complete code:

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];

Customizing the NavigationBar tintColor, this line works:

objPeoplePicker.topViewController.navigationController.navigationBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];

But, I’d also like to customize the tintColor of the searchBar:

objPeoplePicker.topViewController.searchDisplayController.searchBar.tintColor = [UIColor colorWithRed:0.294 green:0.278 blue:0.247 alpha:1.0];

That line does not work. I think I may be referencing the wrong searchBar….can you point me in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T10:22:49+00:00Added an answer on May 21, 2026 at 10:22 am

    I just ran into the same problem. Changing the navBar color is easy. Changing the UISearchBar color however not so much. First what I did was to check

    if( picker.searchDisplayController == nil ) 
      NSLog(@"searchDisplayController is nil");
    if( picker.topViewController.searchDisplayController == nil ) 
      NSLog(@"topViewController.searchDisplayController is nil");
    

    Both times the searchDisplayController was nil. What I ended up doing was traversing the view hierarchy to find the UISearchBar view. There is certainly one there right. So this is my final code. If anyone has a better solution I would love to hear it.

    static BOOL foundSearchBar = NO;
    - (void)findSearchBar:(UIView*)parent mark:(NSString*)mark {
    
      for( UIView* v in [parent subviews] ) {
    
        if( foundSearchBar ) return;
    
        NSLog(@"%@%@",mark,NSStringFromClass([v class]));
    
        if( [v isKindOfClass:[UISearchBar class]] ) {
          [(UISearchBar*)v  setTintColor:[UIColor blackColor]];
          foundSearchBar = YES;
          break;
        }
        [self findSearchBar:v mark:[mark stringByAppendingString:@"> "]];
      }
    }
    
    - (void)pickPerson:(BOOL)animated {
      foundSearchBar = NO;
      ABPeoplePickerNavigationController *picker = [[ABPeoplePickerNavigationController alloc] init];
      [[picker navigationBar] setTintColor:[UIColor blackColor]];
    
      picker.peoplePickerDelegate = self;
      picker.displayedProperties = [NSArray arrayWithObjects:
                      [NSNumber numberWithInt:kABPersonEmailProperty],
                      nil];
    
      [self presentModalViewController:picker animated:animated];
      [picker release];
    
      [self findSearchBar:[picker view] mark:@"> "];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to customize my button by changing their colors, but when I use
I'm trying to format a Qt lineEdit text with colors. def __init__(self): QtGui.QMainWindow.__init__(self) self.ui
I am trying to customize the UITableViewCell below for an iPhone app in a
I'm trying to customize some TFS work items via the VS2008 xml editor, but
I'm trying to customize the icons drawn by the GDirections object. I've got a
I am trying to customize a UITableView. So far, it looks good. But when
I am trying to customize Django's comments form. Inside django.contrib.comments.forms I noticed that all
I am trying to customize the output of the comments list and forms using
I'm trying to customize a core WP function using my functions.php file. Why won't
I am trying to customize serving of some static resources with renderBinary(). I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.