New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First card appears with wrong frame #147
Comments
I saw this issue also. There is other issues like this, for example there is issue with appearing of a deck when controller is not presented, you will see transparent deck until you swipe first invisible card :) I think that most of this issues is comes from layer animations. We have already done some workarounds for such issues but they are still exist. Most of them is about initial appearance of deck. |
@silviu-geronimo which version of Koloda do you use? |
About wrong frame for first card, unfortunately I can't remember what I've done to fix this but there was bug about it. Probably with was fixed with new animations commit in one of Koloda updates few month ago, not sure... I also clearly remember that there was same issue but with broken frame only for first card, all next cards was right Talking about alpha this is just some dirty hack, I don't even know why this works, but if you just set alpha to 1 it doesn't help: |
@AEugene : I don't know which version I am using, I started the project 3 months ago. I will try to update to the latest version, tough I have made some changes in the code. |
@silviu-geronimo Is your issue resolved? |
@AEugene yep, looks like this case is reproducible when you presenting deck during another controlled is presented instead of one that containing this deck (in our case it's in our custom tab bar) |
This issue is still there, i have it on my current test application. If i use my network call to load datas and reload the view after charging the datas in my callback everything is fine. |
Hello tirrorex, It seemed that I had this issue when I was displaying the view controller during the first card appearing animation (the one that scales the container from CGRectZero to final frame) . If I was displaying it right before/after the animation started/ended it was ok. After lots of code modifications I found out that commenting 'clear()' method will do the trick:
Hope it will fix your problem! Looking forward for a feedback. |
Setting the datasource and refresh the ui in viewDidAppear seems to fix the problem. |
This problem still exist with the swift 3 update. My Koloda cards worked perfectly when I was loading the data from my API, and then telling the cards to reload once I had pulled down the data. It was working because the data was loading after the view had appeared. But, when I had passed the data to my class, as in I had the data right away in viewDidLoad, then the Koloda cards were misplaced. I used to @tirrorex fix to deal with this bug in the short term. |
fyi @silviu-geronimo 's fix worked for me. |
Same here. API callbacks configure the cards correctly, but synchronous data/reload will have the layout all screwed up, noticeable in 4 inch devices. Answer from @tirrorex fixed it temporarily. |
@mrigdon Unfortunately I have to announce you that the bug is still occurring using that fix. I struggle to find a new fix. Maybe @tirrorex answer will do it. @tirrorex and @rickyjwhong: How do you refresh the UI in viewDidAppear ? I am using the code below and it is generating the frame issue that we are complaining here:
|
@silviu-geronimo did you ever figure this out? (your original fix works for me) |
@xiaosongshu the library version that I am using had some methods responding to device rotation. Basically when I was moving the device on a Z axis in the same moment a card swipe was made the final frame of the card was wrong. So first solution I have posted here and removing the rotation handling method made the library works well. |
1 similar comment
@xiaosongshu the library version that I am using had some methods responding to device rotation. Basically when I was moving the device on a Z axis in the same moment a card swipe was made the final frame of the card was wrong. So first solution I have posted here and removing the rotation handling method made the library works well. |
@silviu-geronimo like this : `
My data source comes from realmswift, so after i get the data from realm with a query i append it to my data array (which i use to configure the view) and then i just reload the data. |
@tirrorex are you familiar with how apps do 'lazy load' of images but with kolodaView, where they download async and then get loaded one by one when ready? @silviu-geronimo commenting out |
I experienced the same bug and unfortunately Silviu's fix didn't work for me. I recall that this wasn't happening a few days ago so I reverted to a previous commit and incrementally applied the previous changes. I discovered that this bug was introduced when I added |
For me, this worked in my DispatchQueue.main.async {
self.koloda.reloadData()
} |
I had this problem too where the first frame is having the wrong size in iPad. After looking at this thread, this worked for me. (My datasource is initialized in viewDidLoad.) override func viewDidAppear(_ animated: Bool) {
kolodaView.reloadData()
} |
Has anyone been able to solve this? I'm currently facing it at the moment. When I first build my view the cards are showing alright but when I come back and refresh the view (I make a new data request in viewWillAppear and reload the view on the main thread once I get the data). |
Same issue |
Closed via #259. Let us know if the issue still exist |
The problem seems to be solved but now the animation seems to be glitchy sometimes. It seems like it first appears with wrong frame but then the deck is re-layout again and it jumps to the correct frame. I have noticed that behaviour especially in case of reseting cards in deck and calling I have also noticed that the swipe animation is not fluent when swiping cards fast (also kind of glitchy). Seems like swiped card appears on the top of the deck for a very short time and then disappears. Do you guys experience similar problems? |
I have a problem that occurs very seldom but it's pretty ugly.
First time when I open my screen where I have the draggables cards , the cards appears in very little size and placed in the top left.
Does anyone know how to fix this or is it a fix already existing?
The text was updated successfully, but these errors were encountered: