Tuesday, January 4, 2011

SplitViewController with NavigationBar doesn't retain Tint

Update: This appears to be working in the beta of IOS 4.3!
--------------------

One of the things that is broken in iOS 4.2 is the tint color on the navigation bar in the Root View of the SplitViewController. What happens is that if you set the tint color, it will show correctly until you rotate to portrait mode, tap the List button, then rotate back to landscape.

The issue is discussed in great detail here: https://devforums.apple.com/thread/68443?start=0&tstart=0

One of the proposed solutions is to SubClass the NavigationBar Class and override the setTint method. (Credit goes to Hans Harris)

Below is a link to a complete working implementation.
http://dl.dropbox.com/u/9163557/SplitView_NavBar_setTint2.zip

5 comments:

  1. Hi Andy,

    I've been trying to work this out as well. Thanks for posting your code.

    Question, how do you reset the tint when the the device is in Portrait mode and is displayed in the popover controller?

    ReplyDelete
  2. This comment has been removed by the author.

    ReplyDelete
  3. Works, great. Thanks for that!

    Perhaps you could just help me with one point; how do I get the default black translucent navigation bar back again, in the popover?

    I'm sure I've read about that somewhere but it's late and I'm losing concentration...

    ReplyDelete
  4. Hi,

    Thanks for the code. It is working great in OS 5.1. But it is not working on OS 5.0. Can you please suggest some work around for OS 5.0

    ReplyDelete