gmoledina / GMGridView

A performant Grid-View for iOS (iPhone/iPad) that allows sorting of views with gestures (the user can move the items with his finger to sort them) and pinching/rotating/panning gestures allow the user to play with the view and toggle from the cellview to a fullsize display.
MIT License
2.3k stars 512 forks source link

Horizontal Paging with Previews Layout Strategy #49

Open bobbypage opened 12 years ago

bobbypage commented 12 years ago

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.

mtrubnikov commented 12 years ago

Yeah, that would be great! :)

rickytan commented 12 years ago

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.

gmoledina commented 12 years ago

@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 ?

rickytan commented 12 years ago

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

gmoledina commented 12 years ago

@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.

rickytan commented 12 years ago

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!

bobbypage commented 12 years ago

@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!

Maverick1st commented 12 years ago

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 :(