zoukankan      html  css  js  c++  java
  • 自定义各种tabBar

    用3个 不同被点击的图片

    #pragma mark - Creat Tab Bar

    -(void)cTabBar

    {

        squareVC=[[SquareViewControlleralloc] init];

        

        upDataVC=[[UpDataViewControlleralloc] init];

        myVC=[[MyViewControlleralloc] init];

        

        NSMutableArray* tabArray=[[NSMutableArrayalloc] init];

        [tabArray addObject:squareVC];

        [tabArray addObject:upDataVC];

        [tabArray addObject:myVC];

        

        tabBar=[[UITabBarControlleralloc] init];

        tabBar.delegate=self;

        tabBar.viewControllers=tabArray;

        tabBar.view.frame=CGRectMake(0, 0, 320, 460);

        tabBar.selectedIndex = 0;

        [self.view addSubview:tabBar.view];

        

        tabImageView=[[UIImageView alloc] init];

        tabImageView.frame=CGRectMake(0, 365, 320, 51);

        tabImageView.image=[UIImageimageNamed:@"left@2x(2).png"];

        [tabBar.tabBarsetBackgroundImage:[UIImageimageNamed:@"left@2x(1).png"]];

        [self.viewaddSubview:tabImageView];

    }

     //点击之后的事件

    - (void)tabBarController:(UITabBarController *)tabBarController didSelectViewController:(UIViewController *)viewController{

        if (viewController == myVC) {

            self.title = @"我的空间";

            [tabImageViewremoveFromSuperview];

            tabImageView=[[UIImageView alloc] init];

            tabImageView.frame=CGRectMake(0, 365, 320, 51);

            tabImageView.image=[UIImageimageNamed:@"right@2x(3).png"];

            [self.view addSubview:tabImageView];

        }

        else if (viewController == upDataVC) {

            self.title = @"上传照片";

            [tabImageViewremoveFromSuperview];

            tabImageView=[[UIImageView alloc] init];

            tabImageView.frame=CGRectMake(0, 365, 320, 51);

            tabImageView.image=[UIImageimageNamed:@"center@2x(2).png"];

            [self.view addSubview:tabImageView];

        }

        else if (viewController == squareVC) {

            self.title = @"潮流靓发";

            [tabImageViewremoveFromSuperview];

            tabImageView=[[UIImageView alloc] init];

            tabImageView.frame=CGRectMake(0, 365, 320, 51);

            tabImageView.image=[UIImageimageNamed:@"left@2x(2).png"];

            [self.view addSubview:tabImageView];

        }

    }

  • 相关阅读:
    Tosca IE 浏览器的Internet Options 配置, 解决login很慢的问题
    Tosca 注意事项(持续更新)
    Tosca database help link
    Tosca TestCases: Update all,Checkin all,Checkout,Checkout Tree
    Tosca Connection Validation error:40
    Tosca new project Repository as MS SQL Server
    【笔记4】用pandas实现条目数据格式的推荐算法 (基于用户的协同)
    【笔记3】用pandas实现矩阵数据格式的推荐算法 (基于用户的协同)
    【笔记2】推荐算法中的数据格式
    【笔记1】如何预测用户对给定物品的打分?
  • 原文地址:https://www.cnblogs.com/monnRedShine/p/3123195.html
Copyright © 2011-2022 走看看