第一步:
//在info.plist中添加一個字段:view controller -base status bar 設置為NO;//導航顏色[[UINavigationBar appearance] setBarTintColor:[UIColor XXXX]];[[UITableViewCell appearance] setBackgroundColor:[UIColor XXXX]];//設置狀態欄(信號區)白色[[UIapplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];//默認帶有一定透明效果,可以使用以下方法去除系統效果[navigationController.navigationBar setTranslucent:NO];//更改導航標題字體大小與顏色要在第一級頁面設置 如下// 設置導航默認標題的顏色及字體大小self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor: [UIColor whiteColor], UITextAttributeFont:[UIFont boldSystemFontOfSize:18]};
第二步:
//UIImageRenderingModeAlwaysOriginal 讓圖片表現的模式為圖片的原始樣式 用于去掉系統添加的顏色self.tabBarController.tabBarItem.title = @"title";if ([[UIDevice currentDevice] systemVersion].floatValue >= 7.0) {[self.tabBarController.tabBarItem setFinishedSelectedImage:[[UIImage imageNamed:@"Image.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] withFinishedUnselectedImage:[[UIImage imageNamed:@"ImageS.png"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];}else{[self.tabBarController.tabBarItem setFinishedSelectedImage:[UIImage imageNamed:@"Image.png"] withFinishedUnselectedImage:[UIImage imageNamed:@"ImageS.png"]];}//tabbar顏色 用于更改字體顏色[self.tabBarController.tabBar setTintColor:[UIColor XXXX]];
Demo地址:
https://github.com/wly314/HappyTravel
歡迎交流。
新聞熱點
疑難解答