You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_oldSelectedTabBarItemIndex = -1; // When nothing is selected
- (void)infiniteTabBar:(InfiniteTabBar *)tabBar didSelectItemWithTag:(int)tag {
// Prevent to fire didSelectItemWithTag: if the item is already selected
if (tag == _oldSelectedTabBarItemIndex) {
return;
}
// Sometimes last seelcted item was on second tabbar but by default always first tabbar will be displayed on load, we need to scrol to tabbar which contains selected item. I need this because app. remembers last selected tag on exit and restores state on load ..
NSInteger tabItemsPerTabBar = 5;
if (tag / tabItemsPerTabBar >= 1.0) {
int indexOfTabBarForSelectedItem = (int)(tag / tabItemsPerTabBar);
if (self.tabBar.currentTabBarTag != indexOfTabBarForSelectedItem) {
[self.tabBar scrollToTabBarWithTag:indexOfTabBarForSelectedItem animated:NO];
}
}
_oldSelectedTabBarItemIndex = tag;
}
}
I did this in my viewController which is InfiniteTabBarDelegate. May be this should be done as part of InfiniteTabBar implementation. Anyway InfiniteTabBar is a great component. Thank you.
The text was updated successfully, but these errors were encountered:
In the init:
I did this in my viewController which is InfiniteTabBarDelegate. May be this should be done as part of InfiniteTabBar implementation. Anyway InfiniteTabBar is a great component. Thank you.
The text was updated successfully, but these errors were encountered: