Skip to content

Commit

Permalink
Allow contents to be always scrollable
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenchan authored and AlanQuatermain committed Mar 5, 2011
1 parent c4ae6c4 commit 1e4fe3d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Classes/AQGridView.m
Expand Up @@ -518,6 +518,8 @@ - (void) setContentSize: (CGSize) newSize
newSize.height = minimumHeight;
}

newSize.height = fmax(newSize.height, self.frame.size.height+1);

CGSize oldSize = self.contentSize;
[super setContentSize: newSize];

Expand Down

5 comments on commit 1e4fe3d

@rbruels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please explain this one? This appears to be the offending line that is causing the grid view to bounce vertically even when the content doesn't warrant it!

The problem is easy to reproduce. Make a grid view, layoutDirection=horizontal. Add cells with portraitGridCellSize that matches the grid view's frame height (which would, if working correctly, not bounce vertically).

Perhaps this assumed the grid view's layoutDirection is always the default vertical?

@AlanQuatermain
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would assume that's the case— this doesn't appear to be a line of code I wrote myself, although I do recall a couple of commits from others which enabled or disabled bouncing.

@rbruels
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, meant to address the original author. I'll check with him and double check the need for it, barring one I'll commit a fix. Thanks, Jim.

@stevenchan
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I wrote it myself for my own need, didn't really want it to merge with the main repo, sorry about that.

@jessecurry
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason that this is still in the main repo?

Please sign in to comment.