Coder Social home page Coder Social logo

Comments (3)

rahulskh avatar rahulskh commented on August 19, 2024

figured it out. thanks!

from foldingtabbar.ios.

StormFactory avatar StormFactory commented on August 19, 2024

@rahulskh Since you figured it out, it would be right to share how you did it so others who might have the same concerns can benefit.

from foldingtabbar.ios.

rahulskh avatar rahulskh commented on August 19, 2024

Here is what i did. In my AppDelegate.m I modified setupYALTabBarController

  • (void)setupYALTabBarController
    {
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    self.view1 = [[View1 alloc] init];
    self.view2 = [[View2 alloc]init];
    self.view3 = [[View3 alloc]init];
    self.view4 = [[View4 alloc]init];

    NavigationController *navController1 = [[NavigationController alloc] initWithRootViewController:self.view1];
    NavigationController *navController2 = [[NavigationController alloc] initWithRootViewController:self.view2];
    NavigationController *navController3 = [[NavigationController alloc] initWithRootViewController:self.view3];
    NavigationController *navController4 = [[NavigationController alloc] initWithRootViewController:self.view4];

    //YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) self.window.rootViewController;
    YALFoldingTabBarController *tabBarController = [[YALFoldingTabBarController alloc]init];

    //prepare leftBarItems
    YALTabBarItem *item1 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"Chats"]
    leftItemImage:[UIImage imageNamed:@"Search"]
    rightItemImage:[UIImage imageNamed:@"Cog"]];

    YALTabBarItem *item2 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"Compass"]
    leftItemImage:[UIImage imageNamed:@"Chats"]
    rightItemImage:[UIImage imageNamed:@"Search"]];

    tabBarController.leftBarItems = @[item1, item2];

    //prepare rightBarItems
    YALTabBarItem *item3 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"Group"]
    leftItemImage:[UIImage imageNamed:@"Chats"]
    rightItemImage:[UIImage imageNamed:@"Compass"]];

    YALTabBarItem *item4 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"Cog"]
    leftItemImage:[UIImage imageNamed:@"Chats"]
    rightItemImage:[UIImage imageNamed:@"Search"]];

    tabBarController.rightBarItems = @[item3, item4];

    tabBarController.centerButtonImage = [UIImage imageNamed:@"Plus"];

    tabBarController.selectedIndex = 2;

    tabBarController.viewControllers = [NSArray arrayWithObjects:navController1, navController2, navController3, navController4, nil];

    //customize tabBarView
    tabBarController.tabBarView.extraTabBarItemHeight = YALExtraTabBarItemsDefaultHeight;
    tabBarController.tabBarView.offsetForExtraTabBarItems = YALForExtraTabBarItemsDefaultOffset;
    tabBarController.tabBarView.backgroundColor = HEXCOLOR(0xff0066FF);
    tabBarController.tabBarView.tintColor = [UIColor whiteColor];
    tabBarController.tabBarView.tabBarColor = [UIColor colorWithRed:250.0 green:240.0 blue:230.0 alpha:1];
    tabBarController.tabBarViewHeight = YALTabBarViewDefaultHeight;
    tabBarController.tabBarView.tabBarViewEdgeInsets = YALTabBarViewHDefaultEdgeInsets;
    tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets;
    tabBarController.tabBarView.hidden = NO;

    self.window.rootViewController = tabBarController;
    [self.window makeKeyAndVisible];

}

from foldingtabbar.ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.