Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions InfiniTabBar.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
- (int)selectedItemTag;
- (BOOL)scrollToTabBarWithTag:(int)tag animated:(BOOL)animated;
- (BOOL)selectItemWithTag:(int)tag;
- (void) deSelectAllTabs;
- (void) disableTabItemWithTag:(int)tag;
- (void) enableTabItemWithTag:(int)tag;

@end

Expand Down
28 changes: 28 additions & 0 deletions InfiniTabBar.m
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,34 @@ - (void)tabBar:(UITabBar *)cTabBar didSelectItem:(UITabBarItem *)item {
[infiniTabBarDelegate infiniTabBar:self didSelectItemWithTag:item.tag];
}

- (void) deSelectAllTabs{
for (UITabBar *tabBar in self.tabBars){
tabBar.selectedItem = nil;
[tabBar setNeedsDisplay];
}
}

- (void) disableTabItemWithTag:(int)tag{
for (UITabBar *tabBar in self.tabBars){
for(UITabBarItem *anItem in tabBar.items){
if(anItem.tag == tag){
[anItem setEnabled:NO];
}
}
}
}

- (void) enableTabItemWithTag:(int)tag{
for (UITabBar *tabBar in self.tabBars){
for(UITabBarItem *anItem in tabBar.items){
if(anItem.tag == tag){
[anItem setEnabled:YES];
}
}
}
}


- (void)dealloc {
[bTabBar release];
[aTabBar release];
Expand Down