ssoper (owner)

Revisions

gist: 129748 Download_button fork
public
Description:
Add a tint to your UITabBarController
Public Clone URL: git://gist.github.com/129748.git
Objective-C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
// Add a tint to your UITabBarController
 
// This goes in your implementation (.m) file
CGRect frame = CGRectMake(0.0, 0.0, tabBarController.view.bounds.size.width, 48);
UIView *v = [[UIView alloc] initWithFrame:frame];
[v setBackgroundColor: [UIColor colorWithRed: 0.078f green: 0.204f blue: 0.369f alpha: 0.99f]];
[v setAlpha:0.4];
[[tabBarController tabBar] insertSubview: v belowSubview: [[[tabBarController tabBar] subviews] objectAtIndex: 0]];
[v release];
 
// Don't forget to add a forward reference in your header (.h) file to silence the warnings
@interface UITabBarController (PrivateMethods)
- (UITabBar *) tabBar;
@end