Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Horizontal Paging with Previews Layout Strategy #49

Open
bobbypage opened this Issue Feb 18, 2012 · 8 comments

Comments

Projects
None yet
5 participants

It would cool to have a layout strategy that supports previews. Though this can easily be done by subclassing UIScrollView, GMGridView has some really great additions like lazy loading and UITableView like API.

I'm talking about something like this:

ScrollView

I don't think it will be to hard to implement, a horizontal paging layout strategy already exists, only the "preview" support (of the left and right view) must be implemented.

Yeah, that would be great! :)

rickytan commented Mar 2, 2012

bug exists in horizontal paging when the centerGrid is set to NO.
I won't be able to scroll to the last page fully.
In fact, this was caused by contentSize computing.

Owner

gmoledina commented Mar 26, 2012

@bobbypage I'm not sure I understand what's need to be done in order to achieve the desired result. Doesn't the grid already support this ?

@rickytan are you still experiencing the bug ?

No, I have fixed that. @gmoledina .

Modify the code of the implementation of the method -(void)rebaseWithItemCount:(NSInteger)count insideOfBounds:(CGRect)bounds of Horizontal Paged Strategy in GMGridViewLayouStrategies.m, change the last line which compute the _contentSize to:

_contentSize = CGSizeMake( self.gridBounds.size.width * self.numberOfPages, onePageSize.height );

Owner

gmoledina commented Mar 27, 2012

@rickytan are you using the latest code version ? I think this was fixed a few weeks ago. The code has changed and _contentSize isn't set in the rebase method directly.

I used the code over a month a ago, so I faced the problem.

And thanks for your hard working on this component, it's really nice!

@gmoledina I don't think that the grid view supports this right now. I could get it set up to show one full page at a time, but could didn't figure out on how to show the previews on the left and right of the view. If this is already implemented it would be great to add it as a layout strategy and include a demo as this is a very common task with UIScrollView.

BTW, GMGridView rocks, it works really well and has saved me a lot of time. Thanks!

I am also trying to get the preview for the case, that a page size should be smaller than the bounds of the gridview.

Unfortunately i always get a gap between pages, when the gridview for example is half a row larger than the size of the pages i want to slide through.

I tried reducing the pagesize, but that did only result in a white gap.

I thought i must set the page-size in rectForPoint: but that method is only called once and seems to have no further influence.

I would really be glad, if someone could push me in the right direction.
It shouldn't be so hard to make the displayed content larger than the page-size, but somehow I'm to blind to see it :(

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment