Giter Club home page Giter Club logo

Comments (7)

JoniVR avatar JoniVR commented on June 4, 2024
  • Create a cardView Height constraint

Do you mean creating height constraints for objects inside the cardView?
I would need some clarification on where exactly you are adding a constraint.
A demo project would be even better.

Are you using the sizeForItem delegate function?
Because that function is meant to allow you to change card sizes.

from verticalcardswiper.

mohit196 avatar mohit196 commented on June 4, 2024

I added an NSLayoutConstraint on cardSwiper view height and in didSwipeCardAway, I am updating the height constraint. After updating the cell should opt to new constraints.

I have made some changes to the existing project.

VerticalCardSwiper-master-2.zip

from verticalcardswiper.

JoniVR avatar JoniVR commented on June 4, 2024

So are you saying that the cards don't adapt their size right away once you swipe one away for the first time?

So does adding the following line:

cardSwiper.verticalCardSwiperView.layoutIfNeeded()

below the line where you update the constraint (kind of) fix it for you? (just so I understand what you're talking about)

from verticalcardswiper.

mohit196 avatar mohit196 commented on June 4, 2024

Thanks for update Joni

Use Case:

  • Swipe 2-3 cards upward.
  • Now Swipe away the topmost card, you will see the issue.

Simulator Screen Shot - iPhone XR - 2019-04-03 at 11 24 32

from verticalcardswiper.

JoniVR avatar JoniVR commented on June 4, 2024

Yes, I see it now, alright I'll look into what's causing this sometime when I get the time for it.
If you find a solution yourself in the meantime, feel free to post it here or submit a Pull Request.

from verticalcardswiper.

JoniVR avatar JoniVR commented on June 4, 2024

Hi @mohit196

Quick question, did you try my previous solution?

If I call cardSwiper.layoutIfNeeded() after changing the constraint value it looks like it works to me?

func didSwipeCardAway(card: CardCell, index: Int, swipeDirection: SwipeDirection) {
    cardViewHeightConstraint.constant = 600.0
    cardViewHeightConstraint.priority = .required
    cardSwiper.layoutIfNeeded()
}

VerticalCardSwiper-master-2.zip

from verticalcardswiper.

mohit196 avatar mohit196 commented on June 4, 2024

Yes, and the issue still exists.

I tried:
cardSwiper.layoutIfNeeded()
and
cardSwiper.verticalCardSwiperView.layoutIfNeeded()

from verticalcardswiper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.