uitabbar - UITabBarItem Selected Tab Background: Custom? -


would set custom background selected tabs, far, subclassing way i'm customizing uitabbar/uitabbaritem.

the question is: know (or know find ) property sets background?

there lighter black/grey rounded box around selected tab. i'm aiming @ changing.

ios 4.1 ships game center, , they've customized uitabbar. i'm looking similar.

in order achieve above going need create custom uitabbarcontroller class.

customuitabbarcontroller.h

#import <uikit/uikit.h>  @interface customuitabbarcontroller: uitabbarcontroller {    iboutlet uitabbar *tabbar1; }  @property (nonatomic, retain) uitabbar *tabbar1;  @end 

customuitabbarcontroller.m

#import “customuitabbarcontroller.h”  @implementation customuitabbarcontroller  @synthesize tabbar1;  - (void)viewdidload {    [super viewdidload];    tabbar1.backgroundcolor = [uicolor clearcolor];    cgrect frame = cgrectmake(0, 0, 480, 49);    uiview *v = [[uiview alloc] initwithframe:frame];    uiimage *i = [uiimage imagenamed:@"customimage.png"];    uicolor *c = [[uicolor alloc] initwithpatternimage:i];    v.backgroundcolor = c;    [c release];    [[self tabbar] insertsubview:v atindex:0];    [v release]; }  @end 

you'll need change mainwindow.xib , choose tab bar controller. within property inspector need change class custom class, associate tabbar1 outlet tab bar controller.


Comments

Popular posts from this blog

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

c++ - Convert big endian to little endian when reading from a binary file -