• 《找地儿》


    - (void)viewDidLoad {
    
        [super viewDidLoad];
    
     
    
        tabBar = [[UITabBarController alloc]init];
    
        tabBar.tabBar.backgroundImage = [UIImage imageNamed:@"标题栏背景.png"];
    
        [tabBar.tabBar setSelectionIndicatorImage:[UIImage imageNamed:@"标题栏选中.png"]];
    
        [tabBar.tabBar setTintColor:[UIColor yellowColor]];
    
         
    
        OneViewController *ontVie = [[OneViewController alloc]initWithNibName:@"OneViewController" bundle:nil];
    
        twoViewController *twoV=[[twoViewController alloc]initWithNibName:@"twoViewController" bundle:nil];
    
        threeViewController *threeV = [[threeViewController alloc]initWithNibName:@"threeViewController" bundle:nil];
    
        fourViewController *fourV = [[fourViewController alloc]initWithNibName:@"fourViewController" bundle:nil];
    
     
    
        ontVie.tabBarItem.image = [UIImage imageNamed:@"1.png"];
    
        twoV.tabBarItem.image = [UIImage imageNamed:@"2.png"];
    
        threeV.tabBarItem.image = [UIImage imageNamed:@"3.png"];
    
        fourV.tabBarItem.image = [UIImage imageNamed:@"4.png"];
    
        
    
        ontVie.tabBarItem.title = @"我的收藏";
    
        twoV.tabBarItem.title  = @"自选位置";
    
        threeV.tabBarItem.title = @"当前位置";
    
        fourV.tabBarItem.title = @"更多";
    
        
    
        tabBar.viewControllers = @[ontVie,twoV,threeV,fourV];
    
    }
    
    - (IBAction)ButtonOne:(id)sender {
    
        tabBar.selectedIndex = 0;
    
        [self presentViewController:tabBar animated:YES completion:nil];
    
    }
    
     
    
    - (IBAction)buttonTwo:(id)sender {
    
        tabBar.selectedIndex = 1;
    
        [self presentViewController:tabBar animated:YES completion:nil];
    
    }
    
    - (IBAction)buttonThree:(id)sender {
    
        tabBar.selectedIndex = 2;
    
        [self presentViewController:tabBar animated:YES completion:nil];
    
    }
    
    - (IBAction)setBTN:(id)sender {
    
        tabBar.selectedIndex =3;
    
        [self presentViewController:tabBar animated:YES completion:nil];
    
    }
  • 相关阅读:
    使用NPOI读取Excel表格内容并进行修改
    JSON.parse()和JSON.stringify()
    切图时图片的选择:JPG、PNG、GIF的区别
    用js把数据从一个页面传到另一个页面
    iframe中positioin:fixed失效问题
    YUV格式&像素
    JS中插入节点的方法appendChild和insertBefore的应用
    CSS的相对定位和就对定位
    CSS中的相对定位和绝对定位
    POJ-1734
  • 原文地址:https://www.cnblogs.com/liuyingjie/p/5028054.html
Copyright © 2020-2023  润新知