Skip to content
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

Top-Fold Bug - Unable to scroll centerfold after top-fold #27

Open
jpcguy89 opened this issue Oct 31, 2012 · 2 comments
Open

Top-Fold Bug - Unable to scroll centerfold after top-fold #27

jpcguy89 opened this issue Oct 31, 2012 · 2 comments

Comments

@jpcguy89
Copy link

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.

@honcheng
Copy link
Owner

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

On Wed, Oct 31, 2012 at 11:51 PM, Joe Cavallaro notifications@github.comwrote:

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.

@mwermuth
Copy link

mwermuth commented Nov 5, 2012

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 ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants