【发布时间】:2021-11-22 19:00:41
【问题描述】:
发生在iOS15/iPhone12系列设备上。
多个 CollectionView 用每个计时器分页,但分页仅在 iOS15/iPhone12 设备上无法正常工作。
分页卡顿,动画不正常。
我尝试使用 Rx 实现计时器,但症状相同。
在其他设备、其他iOS版本上正常运行。
有人遇到过和我一样的问题吗?
// CollectionView has the following timer code and performs timer operation independently.
// each CollectionView's paging interval is 1.0 seconds 1.3 seconds and 1.6 seconds.
func startTimer(interval: CGFloat) {
let timer1 = Timer.scheduledTimer(timeInterval: interval,
target: self,
selector: #selector(rolling1),
userInfo: nil,
repeats: true)
}
@objc func rolling1() {
DispatchQueue.main.async {
self.offset1 = CGPoint.init(x: self.offset1.x + UIScreen.main.bounds.width, y: self.offset1.y)
self.collectionView?.setContentOffset(self.offset1, animated: true)
}
}
运动画面如下。
它可以在所有 iOS 14 设备上正常运行。
在除iPhone 12系列以外的iOS15设备上也能正常使用。
【问题讨论】:
-
我对 iPhone 12 系列和 iPhone 13 Pro 有同样的问题。
标签: animation collectionview ios15 iphone12