Skip navigation
This discussion is archived

setTintColor removes pressed-button effect

3600 Views 5 Replies Latest reply: Jan 12, 2010 12:16 AM by sommeralex RSS
sommeralex Calculating status...
Currently Being Moderated
Jan 11, 2010 10:26 AM

If I am setting a the tintColor to my navigation bar, the effect of "clicking a button" disappears. I still can click the button, but the button does not turn "darker" anymore, when getting clicked.

The same thing happens, if I am adding a custom uiToolbar to my navigation bar. As long as I am not setting the tintColor, the button-press-effect is working..

macbook air, Mac OS X (10.6.2)
  • draco33333 Calculating status...
    Currently Being Moderated
    Jan 11, 2010 4:24 PM (in response to sommeralex)
    Can you give any code samples?
    MacBook 13", Mac OS X (10.6.2)
  • K T Level 7 Level 7 (23,215 points)
    Currently Being Moderated
    Jan 11, 2010 6:13 PM (in response to sommeralex)
    Intel iMac X•VI•II, OLED 3D Pano tri-view
  • RayNewbie Level 5 Level 5 (6,810 points)
    Currently Being Moderated
    Jan 11, 2010 10:52 PM (in response to sommeralex)
    Hi Alex -

    I played with tints and bars in the attempt to answer a similar question recently posted by Luther Baker: []. I was unable to do what Luther needed in my testbed, but you only need the first half of his requirements, so I may have learned enough to help.

    Firstly, I discovered that applying a tint in IB would work correctly for both nav and tool bars. However for some reason, if I set the tint programmatically in viewDidLoad, the tool bar controls no longer displayed the highlight (darker) color correctly. I don't remember doing the same test on a nav bar, but I can tell you that getting custom controls to pick up the bar tint is much easier with a nav bar.

    The next question is, "At what point in the life cycle of a tool bar should it be tinted?". I didn't get far enough to answer that, and being clueless about the mechanism didn't help. It might be that the tint needs to be set before the controls are added, and/or before the bar is added to the superview, but I haven't yet tried all the possibilities.

    So my short answer is: Make the toolbar with its controls and add it to the content view in IB. That might exclude using the toolbar that belongs to a nav controller.

    If you must build the toolbar programmatically, someone will need to find the correct point in the creation and load sequence to set the tint. Hopefully I can find my BarTint testbed if further research is necessary.

    \- Ray
    MacBook, Mac OS X (10.5.5)


More Like This

  • Retrieving data ...

Bookmarked By (0)


  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.