Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8446935
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T10:03:32+00:00 2026-06-10T10:03:32+00:00

I am using the Leaves project to move from one pdf page to another

  • 0

I am using the Leaves project to move from one pdf page to another it is working fine. Now the page curl is from left to right and from right to left like a note book. I need to curl it from top to bottom and bottom to top. Does anyone know the methods to do it, or any other templates to do this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T10:03:34+00:00Added an answer on June 10, 2026 at 10:03 am

    The existing leaves view is hard-coded to be left-to-right. You can create a hard-coded top-to-bottom version easily enough, but there may well be more robust generic solutions.

    However, if you definitely must use leaves, you can rewrite its source to suit. The solution below hard-codes for vertical motion. If you need horizontal and vertical options, you will have more work do do.


    Display

    setUpLayers

    Reverse the axes in every call to CGPointMake. This fixes up the gradients that display the shadows.

    Also change topPage.contentsGravity = kCAGravityLeft; to topPage.contentsGravity = kCAGravityBottom; and topPageReverseImage.contentsGravity = kCAGravityRight; to topPageReverseImage.contentsGravity = kCAGravityTop;. This is a subtle change that makes sure incoming pages are displayed with the correct edges.

    setLayerFrames

    Most of the geometry changes happen here. The original code oddly uses view bounds in some places and layer bounds in others. I duplicated those, but it would be good to understand if the distinction is meaningful before using this code in production.

    - (void) setLayerFrames {
        topPage.frame = CGRectMake(self.layer.bounds.origin.x, 
                                   self.layer.bounds.origin.y, 
                                   self.bounds.size.width,
                                   leafEdge * self.layer.bounds.size.height);
        topPageReverse.frame = CGRectMake(self.layer.bounds.origin.x,
                                          self.layer.bounds.origin.y + (2*leafEdge-1) * self.layer.bounds.size.height,
                                          self.bounds.size.width,
                                          (1-leafEdge) * self.layer.bounds.size.height);
        bottomPage.frame = self.layer.bounds;
        topPageShadow.frame = CGRectMake(0,
                                         topPageReverse.frame.origin.y - 40,
                                         bottomPage.bounds.size.width,
                                         40);
        topPageReverseImage.frame = topPageReverse.bounds;
        topPageReverseImage.transform = CATransform3DMakeScale(1, -1, 1);
        topPageReverseOverlay.frame = topPageReverse.bounds;
        topPageReverseShading.frame = CGRectMake(0,
                                                 topPageReverse.bounds.size.height - 50,
                                                 topPageReverse.bounds.size.width,
                                                 50 + 1);
        bottomPageShadow.frame = CGRectMake(0,
                                            leafEdge * self.bounds.size.height,
                                            bottomPage.bounds.size.width,
                                            40);
        topPageOverlay.frame = topPage.bounds;
    }
    

    Interaction

    updateTargetRects

    Where this calculates nextPageRect and prevPageRect, put them on the bottom and top instead of the right and left.

    touchesMoved:withEvent:

    Change self.leafEdge = touchPoint.x / self.bounds.size.width; to self.leafEdge = touchPoint.y / self.bounds.size.height;.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the ActionScript-Facebook API for my project. Facebook now leaves it up to
I am working on an Android project using Eclipse. I want to change the
The project (a standard WAR with Spring) builds and packages fine from the command
I'm working on a project in Unity using C# scripting. The GUI.Box will appear
I am using a visual control in my project that is from a library
I have some code using Lucene that leaves the default conjunction operator as OR,
I'm following https://github.com/joyent/node/wiki/Using-Eclipse-as-Node-Applications-Debugger and leaves me with questions How can I see what variables
I have an Actionscript project that I was building using Flash CS4. I embedded
I am using git to develop against a project hosted in subversion, using git-svn:
We're currently converting a Delphi 2007 project to Delphi 2010. We were already using

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.