Added ´- (void)scrollToPageIndex:animated:´ method to programmatically scroll to a specific page #148

Open
wants to merge 4 commits into
from

Conversation

Projects
None yet
4 participants
@kimar

kimar commented Sep 7, 2012

By calling the ´- (void)scrollToPageIndex:animated:´ the GMGridView scrolls to the specific page. May be used to scroll by using <- | -> Arrow Buttons etc.

@valleyman86

This comment has been minimized.

Show comment Hide comment
@valleyman86

valleyman86 Nov 20, 2012

I have a small issue with this fix. I feel the following lines may only work for ipad. Also if the gridview is not the full size of the screen it does not accurately scroll.

int orientationOffset = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])?768:1024;
int scrollToX = orientationOffset * index;

I was able to fix this problem by changing the code to

int scrollToX = self.frame.size.width * index;

I have a small issue with this fix. I feel the following lines may only work for ipad. Also if the gridview is not the full size of the screen it does not accurately scroll.

int orientationOffset = UIInterfaceOrientationIsPortrait([[UIApplication sharedApplication] statusBarOrientation])?768:1024;
int scrollToX = orientationOffset * index;

I was able to fix this problem by changing the code to

int scrollToX = self.frame.size.width * index;
@henrytkirk

This comment has been minimized.

Show comment Hide comment
@henrytkirk

henrytkirk Nov 30, 2012

Correct me if I'm wrong, but shouldn't it be:

    int scrollToX = self.frame.size.width * index;

Instead?

Correct me if I'm wrong, but shouldn't it be:

    int scrollToX = self.frame.size.width * index;

Instead?

This comment has been minimized.

Show comment Hide comment
@kimar

kimar Dec 5, 2012

Owner

You are absolutely right, a fix will be following in some minutes...

Owner

kimar replied Dec 5, 2012

You are absolutely right, a fix will be following in some minutes...

@laGrave

This comment has been minimized.

Show comment Hide comment
@laGrave

laGrave Feb 19, 2013

Doesn't work in paged layout strategy

laGrave commented Feb 19, 2013

Doesn't work in paged layout strategy

@kimar

This comment has been minimized.

Show comment Hide comment
@kimar

kimar Feb 20, 2013

Which paged layout do you exactly mean? I've been using it with the HorizontalPagedLTR and am experiencing no problems, what problems do occur?

kimar commented Feb 20, 2013

Which paged layout do you exactly mean? I've been using it with the HorizontalPagedLTR and am experiencing no problems, what problems do occur?

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