Navbar和Tabbar常用设置

1.navBar

 

 

     [self.navigationController.navigationBar setBackgroundImage:navBarImage forBarMetrics:UIBarMetricsDefault];
     [self.navigationController.navigationBar setShadowImage:navBarImage];
     [[UINavigationBar appearance]setBarTintColor:col];//导航栏颜色
     nvc1.navigationBar.tintColor=[UIColor grayColor];//字体颜色
     [[UINavigationBar appearance]setTintColor:[UIColor grayColor]];////字体颜色

     if ([[[UIDevice currentDevice]systemVersion]doubleValue]>7.0) {
            NSLog(@">7.0");
            // 设置导航默认标题的颜色及字体大小
            self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName: [UIColor blackColor],NSFontAttributeName : [UIFont

            boldSystemFontOfSize:18]};
        }else{
            NSLog(@"<=7.0");
            // 设置导航默认标题的颜色及字体大小
            self.navigationController.navigationBar.titleTextAttributes = @{UITextAttributeTextColor: [UIColor blackColor],UITextAttributeFont : [UIFont                  

             boldSystemFontOfSize:18]};
        }

 

2.tabbar

 

    nav1.tabBarItem.title=@"听音乐";
    nav1.tabBarItem.selectedImage=[[UIImage imageNamed:@"music_s.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nav1.tabBarItem.image=[[UIImage imageNamed:@"music.png"]imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    nav1.tabBarItem.badgeValue=@"love";
    rootTab.viewControllers=@[nav1,nav2,nav3,nav4];
    self.tabBarController.tabBar.hidden=before;

 



3.状态栏
        [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleDefault];

 

posted @ 2016-11-08 09:45  有棱角的圆  阅读(1203)  评论(0编辑  收藏  举报