zoukankan      html  css  js  c++  java
  • 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];

  • 相关阅读:
    c++ 学习笔记
    python 2048游戏控制器
    c++ 动态内存
    c++ 拷贝构造函数、拷贝运算符、析构函数
    c++ struct enum union加typedef与不加typedef
    c++ 动态内存2
    c++ 指针数组与指向数组的指针
    c++ TextQuery程序
    c++ virtual
    c++ 动态内存 动态数组
  • 原文地址:https://www.cnblogs.com/sunjianfei/p/6041600.html
Copyright © 2011-2022 走看看