3ph / CollectionPickerView

A generic customizable picker view based on UICollectionView.
MIT License
31 stars 10 forks source link

Alignment isn't always centered #1

Closed georgbachmann closed 5 years ago

georgbachmann commented 6 years ago

Hello, I was just trying out your control! Nice work! I just noticed that the alignment isn't always correct. So when running you sample f.e. and just dragging everything to the right, there's strange jumping around.

I was just wondering if you have already fixed that?

Cheers, Geogr

3ph commented 6 years ago

Yes, you are correct. I haven't fixed that yet. I'll try to figure out the issue today.

3ph commented 6 years ago

Could you please check the latest commit? Seems to work fine for me when running the sample now. Thanks

georgbachmann commented 6 years ago

I'd say it's better now, but the selected item isn't centered?!? And also... in the sample... if you go to the far right.. then make it overshoot even further to the right, it then scrolls back a bit.. and then in the end jumps back.. so something is still off i guess :) Anyway... thank you very much for looking into it!

3ph commented 6 years ago

Hm, seems to be centred in portrait but landscape seems to be off, damn. The first and last cell behaviour is a bit jumpy, true. Will have to look into it a bit more :)

georgbachmann commented 6 years ago

When playing with it on device and I am at the first item, then slightly move to the right, it will jump 3 items further... (from Tokyo directly to Aichi)... Not all the time, but quite often... Sometimes when I scroll from Tokyo to Kanagawa and release, it then jumps back to Tokyo...

3ph commented 6 years ago

I made some changes to the alignment, it seems to be centred now for me. Sorry, been a but busy lately.

I have disabled the smoothing for now because the behaviour is not right all the time (as you've noticed). You'll get snapping back to the closest item. I will investigate more when I've got a bit more time.