Giter Site home page Giter Site logo

Comments (2)

honcheng avatar honcheng commented on June 23, 2024

Thanks. Knew I should wait first before merging into master :p

On Wed, Oct 31, 2012 at 11:51 PM, Joe Cavallaro [email protected]:

I've been experimenting with the...err...experimental...top-fold, and
thought I'd try and help out by reporting the bugs I run into. If I slide
to to the topFoldView and return to the centerTableView, I cannot get it to
re-enable scrolling in that view.

I've tried all of the various combinations of enabling and disabling the
topFoldView and bottomFoldView, together with sending setScrollEnabled:YES
to centerTableView with no luck.


Reply to this email directly or view it on GitHubhttps://github.com//issues/27.

from paperfold-for-ios.

mwermuth avatar mwermuth commented on June 23, 2024

Hey i did notice the same bug today and tried to fix it in a very short way. Probably you can use some of it :)

In your RootViewController add the a class Variable and the following function:

float lastContentOffset;
-(void)scrollViewDidScroll:(UIScrollView *)scrollView{

    int scrollDirection;

    if (lastContentOffset > scrollView.contentOffset.y && scrollView.contentOffset.y <= 0) {
        [self.centerTableView setScrollEnabled:NO];
    }
    lastContentOffset = scrollView.contentOffset.y;
}

This will let you unfold you topFold when you are scrolling up.

Then in your PaperFoldView.m find the following function

- (void)animateWithContentOffset:(CGPoint)point panned:(BOOL)panned

and replace the last else compound with the following:

else
 {
     [self.contentView setTransform:CGAffineTransformMakeTranslation(0, 0)];
     [self.bottomFoldView unfoldWithParentOffset:y];
     [self.topFoldView unfoldWithParentOffset:y];
     self.state = PaperFoldStateDefault;

      if ([self.delegate respondsToSelector:@selector(paperFoldView:viewDidOffset:)])
      {
         [self.delegate paperFoldView:self viewDidOffset:CGPointMake(0,y)];
      }

       for (UIView *view in self.contentView.subviews) {
          if([view isKindOfClass:[UITableView class]]){
              [(UITableView*)view setScrollEnabled:YES];
           }
        }
 }

This will enabled the scrolling back when you close your topFold.

Hope this helps and is comprehensible ;)

from paperfold-for-ios.

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.