【发布时间】:2014-12-18 10:37:24
【问题描述】:
我在 MainStoryboard.storyboard 中使用集合视图,显示图像网格。我想在选择项目时从集合视图转到表格视图,即使用以下方法:
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
选择后如何在collectionView的方法中加载tableView?
我的做法:
UIViewController *vc = [[UIStoryboard storyboardWithName:@"SubCategories" bundle:nil] instantiateViewControllerWithIdentifier:@"SubCategories"];
[self.view addSubview:vc.view ];
【问题讨论】:
-
您应该对新场景执行转场,而不是将视图添加到当前视图
-
请详细解释一下如何在collectionview的方法中执行? @Paulw11
-
搜索使用方法
performSegueWithIdentifier -
在 iOS 上执行该操作是一件非常基本的事情。尝试深入研究文档或查看本教程。 raywenderlich.com/50308/storyboards-tutorial-in-ios-7-part-1。祝你好运!
标签: ios xcode uitableview uicollectionview