如何实现点击不同的CollectionViewCell,弹出的View的内容不同

 我来答
回旋木马Hqu
2016-07-11 · TA获得超过549个赞
知道小有建树答主
回答量:428
采纳率:0%
帮助的人:472万
展开全部
在新弹出的view中实现了如下方法:
- (void)initContent:(int)index
{
self.collectionCellStore = [CollectionCellStore sharedStore];

self.DetailImage.image = ((CollectionEntity*)self.collectionCellStore.cellItems[index]).image;
self.DetailText.text = ((CollectionEntity*)self.collectionCellStore.cellItems[index]).title;

[self.view setNeedsDisplay];
}

然后在cell被点击时调用:
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
DetailViewController *detailViewController = [[DetailViewController alloc] init];
[detailViewController initContent:indexPath.row];

[self.navigationController pushViewController:detailViewController animated:YES];

}
苏州蓝晓生物科技有限公司_
2022-08-05 广告
苏州蓝晓生物科技有限公司。标准化核心产品:公司拥有完整的琼脂糖介质、葡聚糖介质、聚甲基丙烯酸酯介质生产线,年产分离介质50000L,产品质量稳定并达到国际领先水平。核心优势:公司核心技术人员拥有近二十年不同基质的基球开发和官能化的丰富技术经... 点击进入详情页
本回答由苏州蓝晓生物科技有限公司_提供
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式