ios7 - To change the color of unselected UITabBar icon in iOS 7? -


i know question has been asked earlier well, still didn't solution searching solution on internet.

i referred following posts:

how can change text , icon colors tabbaritems in ios 7? only able change selected icons color using tintcolor.

how change color of unselected tab bar items in ios 7? in have written own goztabbar class inherited uiview

i want changes default gray color of uitabbar icon when in unselected state.

any highly appreciated. in advance.

i'm assuming not want change color using tintcolor? option use 2 images same, differ in color. 1 image selected tab, other unselected.

in appdelegate.m - (bool)application:(uiapplication *)application didfinishlaunchingwithoptions:(nsdictionary *)launchoptions function, try this.

uitabbarcontroller *tabbarcontroller = (uitabbarcontroller *)self.window.rootviewcontroller; uitabbar *tabbar = tabbarcontroller.tabbar;  // repeat every tab, increment index each time uitabbaritem *firsttab = [tabbar.items objectatindex:0];  // repeat every tab firsttab.image = [[uiimage imagenamed:@"someimage.png"] imagewithrenderingmode:uiimagerenderingmodealwaysoriginal ]; firsttab.selectedimage = [[uiimage imagenamed:@"someimageselected.png"]imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; 

edit: don't have tab bar controller root view controller, can grab controller , rest of code same.

uitabbarcontroller *tabbarcontroller = self.tabbarcontroller;


Comments

Popular posts from this blog

python - Subclassed QStyledItemDelegate ignores Stylesheet -

java - HttpClient 3.1 Connection pooling vs HttpClient 4.3.2 -

SQL: Divide the sum of values in one table with the count of rows in another -