我有一个 UIView->UICollectionView->UICollectionViewCell
.我正在尝试以编程方式导航回来,但这些都不起作用.代码确实调用了.我正在使用 StoryBoard.
I have a UIView->UICollectionView->UICollectionViewCell
. I am trying to navigate back programatically but none of these works. The code did called.
I am using StoryBoard.
- (void) goBack:(NSNotification *) notification {
// [self.navigationController popViewControllerAnimated:YES];
// [self dismissViewControllerAnimated:YES completion:nil];
[self.navigationController popToRootViewControllerAnimated:YES];
}
你需要使用:
[self.navigationController popToRootViewControllerAnimated:YES];
这将带您回到根视图控制器.
This will bring you back to the root view controller.
如果你想导航回之前的视图控制器,你应该实现:
If you want to navigate back to previous view controller, you should implement:
[self.navigationController popViewControllerAnimated:YES];
这篇关于导航回上一个视图控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!