Coder Social home page Coder Social logo

Curl from left to right about xbpagecurl HOT 4 CLOSED

xissburg avatar xissburg commented on June 19, 2024
Curl from left to right

from xbpagecurl.

Comments (4)

xissburg avatar xissburg commented on June 19, 2024

You have to set the initial cylinder properties before adding the XBCurlView in your view hierarchy. Then, you just have to animate them. To do a flip to the previous page, you can set the cylinder position to (0,0), angle π/2 and radius 0. Then animate it to the other side of the screen, for instance set the cylinder position to (width,0) and angle π/4. For the radius, you could increase it till half the animation duration and then decrease it, like set it to 80 in the middle of the animation and then set it to 20 to the end (use a completion block). Hope this helps.

from xbpagecurl.

mgruendler avatar mgruendler commented on June 19, 2024

Hmm, no that is not what I meant to say. You are correct, with your example values the curling takes place from left to right - but it actually simply "uncurls" the curling of the other direction.

What I need to to is, that the edge of the curled view starts to "lift" in the bottom left corner of the page. With Your values the whole page "uncurls" until the edge of the curled view settles in the bottom right corner. Basically I need to mirror the normal curling effect.

I hope I could explain it properly.

from xbpagecurl.

xissburg avatar xissburg commented on June 19, 2024

Ah, right, now I understand. It's very easy to do that actually. You just
have to rotate the cylinder in the other direction, for instance, set it to
M_PI/2, and move the cylinder from left to right. What happens is that the
view curls after the cylinder, then if you rotate it more the 90 degrees
clockwisely it should start to curl in the other direction.

Hope this helps.
On Oct 26, 2011 8:08 PM, "Marcus Grndler" <
[email protected]>
wrote:

Hmm, no that is not what I meant to say. You are correct, with your example
values the curling takes place from left to right - but it actually simply
"uncurls" the curling of the other direction.

What I need to to is, that the edge of the curled view starts to "lift" in
the bottom left corner of the page. With Your values the whole page
"uncurls" until the edge of the curled view settles in the bottom right
corner. Basically I need to mirror the normal curling effect.

I hope I could explain it properly.

Reply to this email directly or view it on GitHub:
#12 (comment)

from xbpagecurl.

mgruendler avatar mgruendler commented on June 19, 2024

Smile :-)! Okay now I figured it out. After watching my app making some very interesting dancing pirouettes while searching for good start and target angles, I am using these values now which seem to look fine:

self.cylinderAngle = 5_M_PI/3;
CGFloat targetCylinderAngle = 3_M_PI/2;

Many thanks for your hints!

from xbpagecurl.

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.