Abhishek
Abhishek

Reputation: 303

change uitabbar background color

I am write this code but the warning is show "insertSubview" may not respond

- (void)viewDidLoad {

    [super viewDidLoad]; 

    CGRect frame = CGRectMake(0, 0, 480, 49);

    UIView *v = [[UIView alloc] initWithFrame:frame];

    UIImage *i = [UIImage imageNamed:@"GO-21-TabBarColorx49.png"];

    UIColor *c = [[UIColor alloc] initWithPatternImage:i];

    v.backgroundColor = c;

    [c release];

    [[self tabBar] addSubview:v];

    [v release];

}

Upvotes: 0

Views: 1603

Answers (1)

smdvlpr
smdvlpr

Reputation: 1088

Did you try

[[self tabBar] insertSubview:v atIndex:0];

Instead of addSubview:

Source: Changing Tint / Background color of UITabBar

Upvotes: 1

Related Questions