插座无法连接到 CollectionView 单元格中的重复内容 [英] Outlets cannot be connected to repeating content in CollectionView Cells

查看:11
本文介绍了插座无法连接到 CollectionView 单元格中的重复内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在已声明为的 UICollectionViewCell 中连接 UILabel 时

When I am trying to connect a UILabel in a UICollectionViewCell that has been declared as

@property (nonatomic, weak) IBOutlet UILabel *Title;

表明:

插座无法连接到重复内容.

Outlet cannot be connected to repeating content.

我做了一些搜索,发现我需要在 UIView 和 UICollectionView 之间使用某种插座的连接.但我不明白该怎么做.那么如何建立这样的连接,以便访问 UICollectionViewCell 中的 UILabel 呢?

I have done some search and find out that I need to use some kinds of connection of the outlet between UIView and the UICollectionView. But I do not understand what to do exactly. So how could I make such a connection so that UILabel in the UICollectionViewCell can be accessed?

推荐答案

你需要继承 UICollectionViewCell 你应该在你的集合视图中使用它.子类是您将添加插座的地方.

You need to subclass UICollectionViewCell which you should use in your collection view. The subclass is where you will add the outlet.

这篇关于插座无法连接到 CollectionView 单元格中的重复内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆