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

  • 相关阅读:
    安装python3的详细教程
    MySQL中的各种引擎
    MySQL的语句执行顺序
    MySQL 5.7新增加的json数据类型
    MySQL5.6 PERFORMANCE_SCHEMA 说明
    MySQL中的sys系统数据库是干嘛的
    MySQL中information_schema数据库是干啥的
    mysql中You can’t specify target table for update in FROM clause错误解决方法
    win10 localhost 解析为::1 的解决办法
    python 中对象is和==是怎么比较的
  • 原文地址:https://www.cnblogs.com/lidongxiao/p/4949953.html
Copyright © 2011-2022 走看看