开发者

UiTabBar hijack click

I have a UITabBar and on the last tab, visually 5th, i want to make it logout the user amd not show a view. I then want the 1st tabbar item t开发者_Go百科o be selected afyer logout is successful. Has anyone seen how to do this?

Tia


Something like this should do the trick:

The UITabBarControllerDelegate has a method:

- (BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController

Check this for the fifth item and return NO, then after the process of logging out is complete, set the tab to 1 programatically.

[tabBar setSelectedItem:firstController];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜