【发布时间】:2021-07-05 01:58:07
【问题描述】:
我创建了一个带有视图控制器的项目,该项目设置为初始项目。还有另一个视图控制器,它是 UITableViewController 的子类,它呈现 UITableViewCell 的子类,它有一个图像视图的出口。
初始视图控制器上的按钮显示表格视图控制器,该控制器在“willDisplayCell”方法中设置单元格图像出口的转换属性的动画。当 tableview 显示为卡片时它不起作用(modalPresentationStyle == .automatic),它在 modalPresentationStyle == .fullScreen 时起作用
这是一个 UIKit 错误吗?我的配置是 Xcode 12.4 (iOS 14.4)
override func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
guard let cell = tableView.dequeueReusableCell(withIdentifier: "cel") as? CustomCell {
fatalError()
}
UIView.animate(withDuration: 0.2, delay: 0, options: [.repeat, .autoreverse]) {
cell.customImage.transform = .init(scaleX: 1.2, y: 1.2)
}
}
class CustomCell {
@IBOutlet private(set) var customImage: UIImageView!
}
【问题讨论】:
标签: ios uitableview uikit uiviewanimation