zoukankan      html  css  js  c++  java
  • 标签视图控制器UITabBarController

    标签视图控制器 UITabBarController

    FirstViewController*first = [[FirstViewController alloc] init];

    //创建一个UITableBarItem对象,作为first的 tabBarItem属性

    //选中与不选中图片可以一样,可以不一样

    UITabBarItem *item = [[UITabBarItem alloc] initWithTitle:@"第一" image:[UIImage

    imageNamed:@"02-redo.png"] selectedImage:[UIImage imageNamed:@"07-map-marker.png"]];

    first.tabBarItem= item; [item release];

    UINavigationController*firstNC = [[UINavigationController alloc] initWithRootViewController:first];

    SecondViewController*second = [[SecondViewController alloc] init];

    second.tabBarItem.title = @"第二";

    second.tabBarItem.image= [UIImage imageNamed:@"07-map-marker.png"];

    UINavigationController *secondNC = [[UINavigationController alloc] initWithRootViewController:second];

    /创建一个标签视图控制器 //最多显示5个.而且是以平分的姿态显示,多出5个

    显示more-

    UITabBarController *tabbarController= [[UITabBarController alloc] init];

    tabbarController.viewControllers = @[firstNC,secondNC,thirdNC,fourthNC,fifthN C,sixNC];

    //标签条设置

    tabbarController.tabBar.tintColor = [UIColor orangeColor];

    tabbarController.tabBar.barTintColor = [UIColor greenColor];

    tabbarController.delegate = self;

    self.window.rootViewController = tabbarController;

    //选中第一个控制器为登陆是控制器 self.selectedIndex = 3;

    //oneSelfNVC.tabBarController.selectedIn dex = 2;

    //设置颜色tabBar
    // self.tabBar.tintColor = [UIColor purpleColor];
    // self.tabBar.barTintColor = [UIColor blueColor]; 

  • 相关阅读:
    一位区域销售经理百条经验手记
    PAIP.FLEX与JAVA数据对应关系.txt
    转:java生成EXCEL表格(POI vs JXL)
    逆向分析工具介绍
    applet与SERLET交互...
    AT命令集(
    关于WINDOWS超级终端的使用来调试MODEM,串口.
    poj1331
    poj1338
    poj1325
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4949953.html
Copyright © 2011-2022 走看看