aataraxiaa / ScalingCarousel

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

select cell and the cell moves to left a bit #13

Closed athemer closed 6 years ago

athemer commented 7 years ago

hi, when I select the cells, it scrolls a little bit to the left. also, for example, if I have a tab bar vc as parent and two child vc. I add the collectionView to child A, the same situation happens when I switch back from vc B. Is this fixable ? thanks !

StPayne55 commented 7 years ago

I'm having the same issue. When selecting a cell, I perform a push segue. After unwinding back to the collection view screen, the cells overlap and sometimes the last cell is scaled to around 1.5 it's normal size.

jshrager commented 7 years ago

Yeh I'm having same issue - glad someone else has. I've added two screenshots. When I first load it works fine, but when i tap a cell and open another view controller and then close that view controller it goes horribly wrong!

screen shot 2017-09-17 at 17 27 11 screen shot 2017-09-17 at 17 27 22
aataraxiaa commented 7 years ago

Thanks for the screenshots @jshrager, I'll look in to this.

jshrager commented 7 years ago

Not sure if you've found / replicated issue yet - but i have app on my iPhone 7 Plus running iOS 11 and not seen the issue yet - but when i put it on my wife's iPhone 6s 10.3 originally this is how i saw the issue.

aataraxiaa commented 7 years ago

Thanks for update @jshrager, I have reproduced in the sample app in this repo, and aim to get a fix in as soon as I can.

cnbuff410 commented 6 years ago

I'm running into a similar issue, but not completely the same. For me I put the carousel inside a ScrollView, every time when I do "pull to refresh" all the cards become to be same size and make the screen very crowded, similar to what @jshrager shows here.

Any known solution for this?

aataraxiaa commented 6 years ago

I have not had time to look in to this yet. If you get a chance to investigate, maybe you could propose a solution and open a PR.

kingsofteng commented 6 years ago

I think you guys are having this issue because of not connecting ScrollView Delegate. Thanks.

aataraxiaa commented 6 years ago

Thanks @kingsofteng. The readme states that you need to set the collection delegate. Does this solve you issue @athemer @StPayne55 @cnbuff410 @jshrager ? If so, I will close this.

cnbuff410 commented 6 years ago

I have both data source and delegateset to my main view controller if it is what you mean.

cnbuff410 commented 6 years ago

I just manually call "didScroll()" every time the screen show up on the phone, and that solve the issue for me temporarily.

aataraxiaa commented 6 years ago

Ok, thanks for the feedback @cnbuff410 . I will try to find a long-term solution when I get the time.

edurd commented 6 years ago

How did you manage to add shadow to the cell? @jshrager

tolikvasylyk commented 6 years ago

Interesting for me too, because the shadow is clipped if I try to add it. Did you add it like another view on the sides of MainView?

pabsanmez commented 6 years ago

I faced the same issue but It gets solved with

    func scrollViewDidScroll(_ scrollView: UIScrollView) {
        carousel.didScroll()
    }

As the usage says:

Set your UIViewController as the collection view delegate and implement the UIScrollViewDelegate method scrollViewDidScroll(:). In this method, call the didScroll() method of ScalingCarouselView.

aataraxiaa commented 6 years ago

Thanks @pabsanmez for pointing out the correct solution 👍🏼