//導航欄左右按鈕圖片和文字的顏色(系統(tǒng)自己的圖片和文字)
self.navigationController.navigationBar.tintColor = [UIColor whiteColor];
//UIBarMetricsDefault 豎屏格式 高度:44
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"navigationbar.png"] forBarMetrics:UIBarMetricsDefault];
//UIBarMetricsCompact 橫屏樣式 高度:32
[self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"nav-32.png"] forBarMetrics:UIBarMetricsCompact];
//調(diào)導航欄標題的的顏色和大小
[self.navigationController.navigationBar setTitleTextAttributes:@{NSFontAttributeName:[UIFont systemFontOfSize:18],NSForegroundColorAttributeName:[UIColor blueColor]}];
//導航頁面的跳轉(zhuǎn)
[self.navigationController pushViewController:seven animated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];
//self.navigationController.viewControllers 找到push過去的頁面,并放到數(shù)組里面
NSArray *viewController = self.navigationController.viewControllers;
[self.navigationController popToViewController:viewController[2] animated:YES];
#pragma mark - 按鈕的點擊事件
- (void)buttonClick:(UIButton *)button{
//返回任意某一頁
//self.navigationController.viewControllers 找到push過去的頁面阁将,并放到數(shù)組里面
NSArray *viewController = self.navigationController.viewControllers;
[self.navigationController popToViewController:viewController[2] animated:YES];
}
//整體全局更改title的文字和顏色和大小
NSDictionary *dic = @{NSForegroundColorAttributeName : [UIColor redColor], NSFontAttributeName : [UIFont systemFontOfSize:17.0]};
[[UINavigationBar appearance] setTitleTextAttributes:dic];
//設置選項欄項文字選中和不選中的顯示狀態(tài)(顏色或是大小)
[nav1.tabBarItem setTitleTextAttributes:dic forState:UIControlStateNormal];
[nav1.tabBarItem setTitleTextAttributes:selectDic forState:UIControlStateSelected];
//設置選中tabBar選中后圖片的顏色額
[self.tabBar setSelectedImageTintColor:[UIColor whiteColor]];
//設置tabBar樣式
[self.tabBar setBarStyle:UIBarStyleBlack];
//設置按鈕跳轉(zhuǎn)到tabBar的任意一個view
self.tabBarController.selectedViewController = self.tabBarController.viewControllers[1];
最后編輯于 :
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者