【问题标题】:iOS Swift: animating CollectionViewCell elements from a button on the CollectionViewiOS Swift:从 CollectionView 上的按钮为 CollectionViewCell 元素设置动画
【发布时间】:2015-02-08 20:20:18
【问题描述】:

我在 CollectionView 上有一个按钮,可以为 CollectionView 上的标签设置动画(来回滑动它们)。我想知道是否可以使用相同的按钮为单元格上的标签设置动画。

我曾考虑将 collectionView:performAction 作为一种可能的解决方案,但我想在花太多时间找出可能不起作用的东西之前获得一些其他想法。

【问题讨论】:

    标签: ios swift uicollectionview uicollectionviewcell


    【解决方案1】:

    宾果游戏:

    for item in self.collectionView!.visibleCells() as [UICollectionViewCell] {
            var indexpath : NSIndexPath = self.collectionView!.indexPathForCell(item as CollectionViewCell)!
            var cell : CollectionViewCell = self.collectionView!.cellForItemAtIndexPath(indexpath) as CollectionViewCell
    
            //access cell data
            println(cell.labelName.text)
        }
    

    找到here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2017-05-31
      • 1970-01-01
      • 2021-05-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多