The way a code implementation of this to write a lot of code, each controller to write UIImage *image=[uiimage imagenamed:@ "Tabbar_friendtrends_click_icon"];//do not let TabBar bottom have render key Code Image=[image imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; Vc01.tabbaritem.selectedimage=image; Change text style, size, color nsmutabledictionary *atts=[nsmutabledictionary dictionary];//change text size below Tabbar atts[nsfontattributename ]=[uifont systemfontofsize:12];//Change the text color Atts[nsforegroundcolorattributename]=[uicolor DarkGrayColor]; Nsmutabledictionary *selectedatts=[nsmutabledictionary Dictionary];
Selectedatts[nsfontattributename]=[uifont Systemfontofsize:12];
Selectedatts[nsforegroundcolorattributename]=[uicolor Greencolor]; [Vc01.tabbaritem Settitletextattributes:selectedatts forstate:uicontrolstateselected]; Mode two changes in the Assets.xcassets folder after the change without code and within all controllers will be acting to the specific operation appearance properties//through appearance unified set all the Uitabbaritem text attributes// The following method with Ui_appearance_selector, can be set through appearance consent settings such as Uitabbaritem text attribute case;
Nsmutabledictionary *atts=[nsmutabledictionary Dictionary];
Atts[nsfontattributename]=[uifont Systemfontofsize:12];
Atts[nsforegroundcolorattributename]=[uicolor Graycolor];
Nsmutabledictionary *selectedatts=[nsmutabledictionary Dictionary];
Selectedatts[nsfontattributename]=atts[nsfontattributename]; Selectedatts[nsforegroundcolorattributename]=[uicolor darkgraycolor];//Here just change, all the text is changed Uitabbaritem *item=[ Uitabbaritem appearance];
[item Settitletextattributes:atts Forstate:uicontrolstatenormal];
[item Settitletextattributes:selectedatts forstate:uicontrolstateselected];
Adding a child controller
Uiviewcontroller *vc01=[[uiviewcontroller Alloc]init];
Vc01.view.backgroundcolor=[uicolor Redcolor];
[Email protected] "essence";
Vc01.tabbaritem.image=[uiimage imagenamed:@ "Tabbar_essence_icon"];
UIImage *image=[uiimage imagenamed:@ "Tabbar_friendtrends_click_icon"];
Do not let Tabbar bottom has the rendering key code Image=[image imagewithrenderingmode:uiimagerenderingmodealwaysoriginal]; vc01.tabbaritem.selectedimage=image;//Add the controller to the uitabbarcontroller inside [self addchildviewcontroller:vc01];
Uiviewcontroller *vc02=[[uiviewcontroller Alloc]init];
[Email protected] "new posts";
Vc02.tabbaritem.image=[uiimage imagenamed:@ "Tabbar_new_click_icon"];
Vc02.tabbaritem.selectedimage=[uiimage imagenamed:@ "Tabbar_new_click_icon"];
Vc02.view.backgroundcolor=[uicolor Cyancolor];
[Self ADDCHILDVIEWCONTROLLER:VC02];
Uiviewcontroller *vc03=[[uiviewcontroller Alloc]init];
Vc03.view.backgroundcolor=[uicolor Bluecolor];
[Email protected] "attention";
Vc03.tabbaritem.image=[uiimage imagenamed:@ "Tabbar_friendtrends_icon"];
Vc03.tabbaritem.selectedimage=[uiimage imagenamed:@ "Tabbar_friendtrends_click_icon"];
[Self addchildviewcontroller:vc03];
Uiviewcontroller *vc04=[[uiviewcontroller Alloc]init];
[Email protected] "I";
Vc04.tabbaritem.image=[uiimage imagenamed:@ "Tabbar_me_icon"];
Vc04.tabbaritem.selectedimage=[uiimage imagenamed:@ "Tabbar_me_click_icon"];
Vc04.view.backgroundcolor=[uicolor Yellowcolor]; [Self ADDCHILDVIEWCONTROLLER:VC04];
iOS change Tabbar picture rendering-Don't let Tabbat have blue rendering and modify text