/ Published in: Objective C

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
//header #import <Foundation/Foundation.h> @interface CustomUITabBarController : UITabBarController { } @end //implementation #import "CustomUITabBarController.h" @interface UITabBarController (private) - (UITabBar *)tabBar; @end @implementation CustomUITabBarController -(float)rgbPercent:(int)rgb { int tmp = (rgb * 100) / 255; } - (void)viewDidLoad { [super viewDidLoad]; CGRect frame = CGRectMake(0.0, 0.0, self.view.bounds.size.width, 48); UIView *v = [[UIView alloc] initWithFrame:frame]; //UIColor *col = [UIColor colorWithRed:[self rgbPercent:0] green:[self rgbPercent:128] blue:1 alpha:1]; UIColor *col = [UIColor colorWithRed:[self rgbPercent:128] green:1 blue:0 alpha:1]; [v setBackgroundColor:col]; [v setAlpha:0.5]; [[self tabBar] addSubview:v]; [v release]; } @end ////////////////////////// sample of use ////////////////////////// CustomUITabBarController *tabBar = [[CustomUITabBarController alloc] init]; [window addSubview:tabBar.view];
Comments
