Stealing the Tweetie 2 tabbar indicator
Posted on Monday, February 15, 2010 @ 17:37 CET
Sometimes you see something so obvious, yet totally original that just seems like the "proper" way of doing it. The latest case for me was in atebits' Tweetie 2 for iPhone. The tab bar has a tiny arrow that animates to indicate the currently selected tab item. In addition to a custom, yet standard indication by turning the icon blue-ish this small animation just makes it even more clear to the user where they are.
So in the tradition of stealing great ideas I tried to find out how to do this. Queue Picasso quote here. Anyways, turns out it was fairly simple - it came down to:
- creating a view to contain a TabBarController and be its delegate
- adding an indicator image to the TabBarController's tab bar
- animating the image to the selected tab bar index when the TabBarController's
didSelectViewControllermethod is fired
I created a small Xcode project (following the NIB-less way) that shows how I cloned it. You can see it in action below:
You can download the Xcode project here. Next up is the pull-down to reload mechanism :)
- paulo


Comments:
excellent stuff man... thanks!
# May 23, 2010 23:30 CET
It looks good except there is a problem with that way you implimented the tab bar controller. If you try to set a UITableViewController or UINavigationController into the view, then you see that it doesn't ever call "viewWillAppear" whenever you step back in the navigation controller. I'm not sure why and I can't figure it out, do you have any ideas?
# June 18, 2010 04:22 CET
Post a comment:
You must have Flash and JavaScript enabled to post a comment.