Blinking parallax on iPhone 8 plus
Streetmage opened this issue · 2 comments
Streetmage commented
There is a problem scrolling 1-st and 2-nd pages. Pages are blinking during slow scrolling. For pages number higher than 3 it works fine. Reproduced on iPhone 8 plus so far for example app.
Streetmage commented
Seems like replacing
if direction == .horizontal {
let width = collectionView.frame.width
let transitionX = -(width * speed * position)
let transform = CGAffineTransform(translationX: transitionX, y: 0)
let newFrame = attributes.bounds.applying(transform)
contentView.frame = newFrame
}
with
if direction == .horizontal {
let width = collectionView.frame.width
let transitionX = -(width * speed * position)
var newFrame = attributes.bounds
newFrame.origin.x = transitionX
contentView.frame = newFrame
}
solves the problem
KelvinJin commented
Wow, nice finding. Ideally the applying method should work exactly the same as setting the origin ourselves. Feels like a UIKit bug or something.