stefanceriu / SCPageViewController

Just like UIPageViewController but better.. :)
MIT License
352 stars 70 forks source link

Calculation of current page doesn't work properly in some cases #12

Closed SoftXperience closed 9 years ago

SoftXperience commented 9 years ago

I have a page view control, which is not used on full screen. It starts with y-offset at 200 and has a height about 368. So, center of the view is at (160, 384). In _calculateCurrentPage the actual frame of a page is calculated correctly with the size (320,368). But as the y-pos (384) of the center is not within the frame, it never returns the correct current page.

stefanceriu commented 9 years ago

Hey,

Can you paste me your currentFrameForPageAtIndex: layouter method implementation ? I though I already fixed this in 2.0 but I would like to recheck it with your example.

Thanks

SoftXperience commented 9 years ago

I'm using the SCParallaxPageLayouter, so I think I don't need to paste it?

stefanceriu commented 9 years ago

Oh okay, got it. I'll try to figure out what's wrong and fix it asap.

stefanceriu commented 9 years ago

I pushed a fix for this on develop, please try it out. It's probably going to do for now but I think I'll need to come up with a better, more robust, solution for the future. Let me know if it's okay and I'll push it to master and release a new version.

Thank you!

SoftXperience commented 9 years ago

Looks good for my case. Thank you for the quick fix!

stefanceriu commented 9 years ago

Perfect ! I pushed it to master and it's now available in v2.0.1.