当前位置: 动力学知识库 > 问答 > 编程问答 >

iphone - 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.

Once 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.

分享给朋友:
您可能感兴趣的文章:
随机阅读: