我有一个视图,使用此代码拉入另一个视图:
secondView = [[SecondView alloc] init];
UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:secondView];
navigationController.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
此第二个视图上的取消按钮具有:
[self.navigationController.modalViewController dismissModalViewControllerAnimated:YES];
但它似乎没有做任何事情。视图仍然存在,我仍然可以与它进行交互。我如何删除它?
答案 0 :(得分:9)
尝试:
[self.navigationController dismissModalViewControllerAnimated:YES]