Segmented control in a navigation bar

Discussion in 'iOS Programming' started by MACloop, Jan 11, 2010.

  1. MACloop macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #1
    Hi all!
    I have a segmented control (style = bar) in my navigation bar defined as titleView like following code:
    self.navigationItem.titleView = segmentedControl;

    It works great but no matter how I change the tint color on the segmented control it always remains black. I would like to have it gray in order to inform the user where he is. How can I do that?

    Thanks in advance,
    MACloop
     
  2. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #2
    I take it that you have a black navigation bar. Items on a navigation controller bar take the tint color of the bar itself.
     
  3. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #3
    mmm... yes it is black. Is there a way to go around this or is it impossible?
     
  4. KoolStar macrumors demi-god

    KoolStar

    Joined:
    Oct 16, 2006
    Location:
    Kentucky
    #4
    Did you set the barstyle to be uibarstyleblack... or did you use a tint color. I think the only way is to use the barstyle and then set the tint of the control. I know that is how the system style buttons are done for example the Blue done button.
     
  5. MACloop thread starter macrumors 6502

    Joined:
    May 18, 2009
    Location:
    Germany
    #5
    Yes I think I have (if I got it right?). I have done the following:

    segmentedControl.tintColor = [UIColor grayColor];
    localNavigationController.navigationBar.barStyle = UIBarStyleBlack;
     

Share This Page