如何从swift中的UICollectionView中的UIView中删除焦点阴影?

Pro*_*air 6 xcode uiview uicollectionview swift tvos

我正在使用swift开发一个tvOS项目,并且水平对齐UICollectionView,每个UICollectionViewCell都是一个由a UIImageView和a 组成的自定义UIView Label.所以我的UICollectionView看起来像这样:

| UIImageView |   | UIImageView |
| Label       |   | Label       |  
Run Code Online (Sandbox Code Playgroud)

我还希望图像随着特定视图的增加而缩小或缩小焦点.在我的集合视图中,我添加了代码

func collectionView(collectionView: UICollectionView, canFocusItemAtIndexPath indexPath: NSIndexPath) -> Bool {
        return true
}
Run Code Online (Sandbox Code Playgroud)

在我的自定义单元类中,我有这条线

imageView.adjustsImageWhenAncestorFocused = true;
Run Code Online (Sandbox Code Playgroud)

所以这有点奏效,虽然有2个问题.

似乎集合中的所有观点都有一个奇怪的阴影,即使它们没有聚焦.然后当它们聚焦时,图像会按预期增长,但它下面会有另一个阴影.你可以在这里看到我的意思:

这个截图

集合中的第一项具有焦点

我怎么摆脱他们?我已经尝试了所有这些,但它们似乎都没有用

contentView.layer.shadowOpacity = 0.0  // My imageView is a subview of this
contentView.layer.shadowColor = UIColor.clearColor().CGColor
imageView.layer.shadowOpacity = 0.0
imageView.layer.shadowColor = UIColor.clearColor().CGColor
Run Code Online (Sandbox Code Playgroud)

Jac*_*rse 3

现在不可能。我将此问题转发给Apple,得到的答复是: https: //forums.developer.apple.com/message/105045#105045