zoukankan      html  css  js  c++  java
  • 导航创建

    - (void)initTabbar

    {

        ZPayViewController *zpay = [[ZPayViewController alloc]init];

        ButlerController *butler = [[ButlerController alloc]init];

        Detail1ViewController *detail = [[Detail1ViewController alloc]init];

        SetPayViewController *setPay = [[SetPayViewController alloc]init];

        NSMutableArray *vcArr = [NSMutableArray arrayWithObjects:zpay,detail,butler,setPay, nil];

        NSArray *titleArr = @[@"帮付宝",@"账单",@"管家",@"设置"];

        NSArray *picArr = @[@"Button_帮付宝_line",@"Button_账单_line",@"Button_管家_line",@"Button_设置_line"];

        NSArray *selectPicArr = @[@"Button_帮付宝_solid",@"Button_账单_solid",@"Button_管家_solid",@"Button_设置_solid"];

        for (int i = 0; i < vcArr.count; i++) {

            UIViewController *vc = vcArr[i];

            vc.title = titleArr[i];

            UINavigationController *nc =[[UINavigationController alloc]initWithRootViewController:vc];

            [nc.tabBarItem setImage:[[UIImage imageNamed:picArr[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

            [nc.tabBarItem setSelectedImage:[[UIImage imageNamed:selectPicArr[i]] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]];

            [vcArr replaceObjectAtIndex:i withObject:nc];

        }

        self.viewControllers = vcArr;

    }

  • 相关阅读:
    动手动脑感想
    原码反码补码
    java测试感想
    报告
    假期报告
    假期报告
    java学习进度
    《大道至简》读后感
    2020/1/31 PHP代码审计之目录穿越漏洞
    [极客大挑战 2019]BabySQL
  • 原文地址:https://www.cnblogs.com/zhaozhongpeng/p/4867845.html
Copyright © 2011-2022 走看看