iphone - Disable action - user taps on tabbar item to go to root view controller -
i want disable default action when user taps tabbar item.
for example, have tabbar tab1, tab2 , tab3. in tab1, user can navigate view1 view3 (view1 > view2 > view3). if user @ view3, , taps tab1, application takes user view1 (the root view controller). want disable functionality. don't want tap on tab1 pop view controllers. how can that?
edit:
this behavior little strange, handy shortcut in case of deep hierarchy!
you can implement following uitabbarcontrollerdelegate methods disable system wide shortcut:
#pragma mark - #pragma mark uitabbarcontrollerdelegate - (bool)tabbarcontroller:(uitabbarcontroller *)tbc shouldselectviewcontroller:(uiviewcontroller *)vc { uiviewcontroller *tbselectedcontroller = tbc.selectedviewcontroller; if ([tbselectedcontroller isequal:vc]) { return no; } return yes; }
if @ uitabbarcontroller delegate there method:
- (bool)tabbarcontroller:(uitabbarcontroller *)tabbarcontroller shouldselectviewcontroller:(uiviewcontroller *)viewcontroller
if implement in class, can check if uiviewcontroller displayed 1 , return no, stop happening.
i had same problem abpeoplepicker object embedded in uitabbarcontroller, in pressing 'contacts' tab second time displayed make abpeoplepicker control show 'groups'
Comments
Post a Comment