开发者

disable double tap on UITabBarItem

Is there a way to disable the double tap on UITabBarItem?

Basically I'm pushing a new view over the log-in page and I don't want to allow the user to be able to go back by tapping the tab twice.

Onc开发者_运维技巧e the user signed in successfully there is no need for the log-in page anymore.

I do the push like this

VC *somevc = [[VC alloc] initWithNibName:@"VC" bundle:nil];
[self.navigationController pushViewController:somevc animated:YES];
[self.navigationController setNavigationBarHidden:NO];
[seomvc release]; 

thanks


In your VC class’s -viewDidAppear:animated:, you can do something like this:

[self.navigationController setViewControllers:[NSArray arrayWithObject:self] animated:YES];

and thereby remove the login screen from the navigation stack entirely. Tapping the tab bar icon will still return to the root view controller—that’s expected behavior, and you should avoid disabling it without good reason—but the root view controller will now be your somevc instead of the login page.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜