iOS 模拟器屏幕截图 2013 年 6 月 19 日 2.43.43 PM.png!主要故事板描述
问问题
1557 次
1 回答
1
这真的很简单。在您的集合视图datasource
方法中,确保通过保持对视图的强引用来区分两个视图,例如作为属性:
if (collectionView == _topCollectionView) {
// provide the data for the top view
}
else {
// provide the data for the bottom view
}
在 中做同样的事情didSelectItemAtIndexPath
。确定已与哪个集合视图交互,为另一个更改适当的数据并重新加载和/或更新您的图像视图。
您需要使用标准视图控制器并手动添加委托和数据源声明。
@interface ViewController : UIViewController
<UICollectionViewDataSource, UICollectionViewDelegate>
于 2013-06-23T09:56:57.820 回答