Open resand opened 7 years ago
I am also faced this issue and I made tab bar as a root view controller instaed of segue so its working without any black screen.
@dineshguptha I also have it as a start, but I use a login screen and it is redirected based on the state, how did you solve it?
Facing the same issue here.
@resand Just trying to shed some light here to:
Attempted to set up a viewController and points segue way to YALFoldingTabBarController. Since the didFinishLaunchingWithOptions of AppDelegate.m has [self setupYALTabBarController], in the (void)setupYALTabBarController:
In AppDelegate.m: YALFoldingTabBarController tabBarController = (YALFoldingTabBarController ) self.window.rootViewController;
Obviously, the app will begin with the YALFoldingTabBarController because it was set as the self.window.rootViewController.
I tried to create a LoginViewController -> Embed a Navigation Controller -> Set initial View Controller -> set Segue way push to the Tab Bar Controller. (src)
Technically, this should work. But, it won't, because in the AppDelegate of the library, it was set as the rootViewController.
If somebody knows how to get around it or modify the AppDelegate by not setting (YALFoldingTabBarController *) as self.window.rootViewController, appreciate it.
until user should login my root view controller is loginViewController (super class of view controller) and after that I am making tab bar as root view contrroller like this ... just I am using this method instaed of performing segue .my app has 5 tabs so am creating 5 YALTabBarItems.
-(void)setUpCustomTabBar {
AppDelegate *appDelegateTemp = (AppDelegate *) [[UIApplication sharedApplication]delegate];
UITabBarController* rootController = [[UIStoryboard storyboardWithName:@"Main" bundle:[NSBundle mainBundle]] instantiateViewControllerWithIdentifier:@"loginToHomeViewController"];
appDelegateTemp.window.rootViewController = rootController;
YALFoldingTabBarController *tabBarController = (YALFoldingTabBarController *) appDelegateTemp.window.rootViewController;
//prepare leftBarItems
YALTabBarItem *item1 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"home_loading_home_icon_off"]
leftItemImage:nil
rightItemImage:nil];
YALTabBarItem *item2 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"home_search_btn_unselector-1"]
leftItemImage:[UIImage imageNamed:@"home_search_btn_unselector-1"]
rightItemImage:nil];
tabBarController.leftBarItems = @[item1, item2];
//prepare rightBarItems
YALTabBarItem *item3 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"chat_camera_icon_off"]
leftItemImage:[UIImage imageNamed:@"chat_camera_icon_off"]
rightItemImage:[UIImage imageNamed:@"chat_camera_icon_off"]];
YALTabBarItem *item4 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"home_heart_btn_unselector-1"]
leftItemImage:nil
rightItemImage:nil];
YALTabBarItem *item5 = [[YALTabBarItem alloc] initWithItemImage:[UIImage imageNamed:@"home_users_btn_unselector-1"]
leftItemImage:nil
rightItemImage:nil];
tabBarController.rightBarItems = @[item3, item4];
tabBarController.centerButtonImage = [UIImage imageNamed:@"chat_camera_icon_off"];
tabBarController.selectedIndex = 0;
//customize tabBarView
tabBarController.tabBarView.extraTabBarItemHeight = YALExtraTabBarItemsDefaultHeight;
tabBarController.tabBarView.offsetForExtraTabBarItems = YALForExtraTabBarItemsDefaultOffset;
tabBarController.tabBarView.backgroundColor = [UIColor colorWithRed:94.f/255.f green:91.f/255.f blue:149.f/255.f alpha:1.f];
tabBarController.tabBarView.tabBarColor = [UIColor colorWithRed:72.f/255.f green:211.f/255.f blue:178.f/255.f alpha:1.f];
tabBarController.tabBarViewHeight = YALTabBarViewDefaultHeight;
tabBarController.tabBarView.tabBarViewEdgeInsets = YALTabBarViewHDefaultEdgeInsets;
tabBarController.tabBarView.tabBarItemsEdgeInsets = YALTabBarViewItemsDefaultEdgeInsets;
}
@dineshguptha you save a lot of my time .... and i thank you for that .
Try solution in https://github.com/Yalantis/FoldingTabBar.iOS/issues/78
Your Environment
Stack
Installation Source
Plugins
Podfile
Image the bug