aataraxiaa / ScalingCarousel

A super simple carousel view with scaling transitions written in Swift
MIT License
756 stars 98 forks source link

Initializing the carousel by showing the second or later item results in wrong scaling #41

Closed mwawrusch closed 4 years ago

mwawrusch commented 6 years ago

When initializing the view (in viewDidLoad)

        scalingCarousel!.scrollToItem(at: IndexPath(row: 1, section: 0), at: .centeredHorizontally, animated: false)
        scalingCarousel!.deviceRotated()

the right item scalng gets messed up. It works fine when I scroll to element 0 though:

img_c176ed739e19-1

aataraxiaa commented 6 years ago

Thanks for opening this @mwawrusch 👍🏼

bijuC1983 commented 6 years ago

Hello @superpeteblaze .. I am faced with the same issue.. Was there a possible fix for this?

aataraxiaa commented 6 years ago

No, this issue has not yet been resolved @bijuC1983.

bijuC1983 commented 6 years ago

For now this solved it for me https://gist.github.com/bijuC1983/8c1bf405e3686c95c12355135c4d3dca

aataraxiaa commented 6 years ago

Thanks for coming back with this @bijuC1983. Do you think this is something that could be added to ScalingCarousel directly? If so, It would be great to open a PR for it

alibozoglu commented 6 years ago

scalingCarousel!.scrollToItem(at: IndexPath(row: 1, section: 0), at: .centeredHorizontally, animated: false) scalingCarousel.reloadItems(at: [IndexPath.init(row: 1, section: 0)])

aataraxiaa commented 4 years ago

Closing as could not reproduce.