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];

  • 相关阅读:
    Android应用基础概念
    Sqlserver Rand
    sqlite3 锁
    上海盛大网络浩方在线招聘网站程序
    代码片段
    泛型类型的返回
    招 .Net 网站程序员, Flash 程序员
    ACS 20070412 TODO
    MSSQL 2005 分页分析及优化
    虚惊一场
  • 原文地址:https://www.cnblogs.com/sunjianfei/p/6041600.html
Copyright © 2011-2022 走看看