You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am subclassing FSPagerViewTransformer as following:
`
class CarouselPagerViewTransformer: FSPagerViewTransformer {
init() {
super.init(type: FSPagerViewTransformerType.ferrisWheel)
}
override func proposedInteritemSpacing() -> CGFloat {
return 10.0
}
override func applyTransform(to attributes: FSPagerViewLayoutAttributes) {
guard let pagerView = self.pagerView else {
return
}
let position = attributes.position
let scrollDirection = pagerView.scrollDirection
guard scrollDirection == .horizontal else { return }
var zIndex = 0
var transform = CGAffineTransform.identity
switch position {
case -5 ... 5:
let itemSpacing = attributes.bounds.width + self.proposedInteritemSpacing()
let count: CGFloat = 14.0
let circle: CGFloat = .pi * 2.0
let radius = itemSpacing * count / circle
let ty = radius
let theta = circle / count
let rotation = position * theta
transform = transform.translatedBy(x: -position * itemSpacing, y: ty)
transform = transform.rotated(by: rotation)
transform = transform.translatedBy(x: 0, y: -ty)
zIndex = Int((4.0 - abs(position) * 10))
default:
break
}
attributes.alpha = abs(position) > 1.0 ? 0.0 : 1.0 // changed from default
attributes.transform = transform
attributes.zIndex = zIndex
}
}
`
However, changing the attributes.alpha from the default to other values (even constant 1) will make the pager view mode to linear instead of ferrisWheel. Could you please help me with this?
The text was updated successfully, but these errors were encountered:
Hi,
I am subclassing FSPagerViewTransformer as following:
`
class CarouselPagerViewTransformer: FSPagerViewTransformer {
}
`
However, changing the attributes.alpha from the default to other values (even constant 1) will make the pager view mode to linear instead of ferrisWheel. Could you please help me with this?
The text was updated successfully, but these errors were encountered: