The methods implemented in the Appdelegate file are:
-(BOOL) Application: (UIApplication *) application didfinishlaunchingwithoptions: (Nsdictionary *) Launchoptions
{
[ self customnavigationbar];
[ self customtabbar];
return YES;
}
Beautify Tabbar
-(void) customtabbar{
Uiedgeinsets standardedgeinsets = Uiedgeinsetsmake (Ten, ten, ten) ;
//Background map of the entire Tabbar
[[Uitabbar appearance] Setbackgroundimage:[[uiimage imagenamed:@ "Tabbar_back"] Resizableimagewithcapinsets:standardedgeinsets Resizingmode:uiimageresizingmodestretch]];
//Set the background image for each item on tab bar when selected
[[Uitabbar appearance] Setselectionindicatorimage:[uiimage imagenamed:@ "Tabbar_selected_back"];
//Set the position size color of the text on the tab bar item
[[Uitabbaritem appearance] Settitlepositionadjustment:uioffsetmake (0,-1)];
[[Uitabbaritem appearance]settitletextattributes:@{
Nsforegroundcolorattributename:[uicolor lightgraycolor],nsfontattributename:[uifont boldSystemFontOfSize:12 ]
} Forstate:uicontrolstatenormal];
[[Uitabbaritem appearance]settitletextattributes:@{
Nsforegroundcolorattributename:[uicolor whitecolor],nsfontattributename:[uifont boldSystemFontOfSize: ]
} forstate:uicontrolstateselected];
}
//Beautify navigation bar
-(void) customnavigationbar{
//Set background color
[[Uinavigationbar appearance] Setbartintcolor:[uicolor Blackcolor]];
//The text color of the status bar when the navigation bar is set
[[Uinavigationbar appearance] setbarstyle:uibarstyleblack];
//Set the background map of the navigation bar
//[[uinavigationbar appearance] setbackgroundimage:[uiimage imagenamed:@ "Navigationbardefault"] ForBarM Etrics:uibarmetricsdefault];
//Set the text color on the left and right buttons
[[Uinavigationbar appearance] Settintcolor:[uicolor Whitecolor]];
//Set the arrow style that appears in the Back button
[[Uinavigationbar appearance] Setbackindicatorimage:[uiimage imagenamed:@ "back_btn"];
[[Uinavigationbar appearance] Setbackindicatortransitionmaskimage:[uiimage imagenamed:@ "back_btn"];
//Set the text style of the middle title
Set Shadow color offset
Nsshadow *shadow = [[Nsshadow alloc]init];
Shadow.shadowcolor = [Uicolor Redcolor];
Shadow.shadowoffset = Cgsizemake (0, 1);
Nsdictionary *dictionary = [Nsdictionary dictionarywithobjectsandkeys:shadow,nsshadowattributename,[uicolor Whitecolor],nsforegroundcolorattributename,[uifont fontwithname:@ "Helveticaneue-condensedblack" size: ],nsfontattributename,nil];
[[Uinavigationbar appearance] settitletextattributes:dictionary];
}
The methods to be implemented in the controller are
-(ID) Initwithcoder: (Nscoder *) adecoder{
self = [super Initwithcoder:adecoder];
if (self) {
[self. Navigationcontroller.tabbaritem setimage:[uiimage imagenamed:@ "Tabbar_item_my_music"];
[self. Navigationcontroller.tabbaritem setselectedimage:[[uiimage imagenamed:@ "Tabbar_item_my_music_ Selected "] imagewithrenderingmode:uiimagerenderingmodealwaysoriginal];
}
return self;
}
Navigation Bar and Tabbar are commonly used for landscaping, which will be added later