I have created a page-based application in Xcode 4, for iPad iOS5.
When I run the app, I can see the pages in the book and can flip them back and forward,
by tap on the screen or by moving the finger from left to right, or right to left.
My problem is that no matter where I’m pressing in the screen, in the borders, the page turns.
I had managed to cancel the flip with fingers with this code:
for (UIGestureRecognizer *gR in self.pageViewController.gestureRecognizers)
{
if ([gR isKindOfClass:[UIPanGestureRecognizer class]])
{
[[gR view] removeGestureRecognizer:gR];
}
}
How can I define a specific area in the screen that when I tap on it, and only it, the page will turn?
I ask this because I put toolbar in the bottom of the screen and when I click on a button in the toolbar the page flips. I want to put 2 arrows on the screen that only when I press on them the page will flip.
Sorry if my explanation is a little bit rusty. Thank you all.
you could hook into the the gesture system and define which area to accept touches for.
In this explanation I assume your RootViewController has a
UIPageViewControlleras a child VC:-Set your root view controller to implement
UIGestureRecognizerDelegate-Take over all gesture recognizers for your pageVC in your RootViewControllers
ViewDidLoad:-Finally implement the gesture recognizer in your RootViewController and define which zones you want to ignore:
Hope this helps