使用PageviewController
委託方法
- (UIViewController *)pageViewController:(UIPageViewController *)pageViewController viewControllerAfterViewController:(UIViewController *)viewController {
if (indexTest < NUM_OF_PAGES) {
switch (indexTest) {
case 0:{
NSLog(@"Page AFTER is Page: %@", [NSString stringWithFormat:@"%@",[viewControllers objectAtIndex:1] ]);
indexTest++;
return [viewControllers objectAtIndex:1];
break;
}
case 1:{
NSLog(@"Page AFTER is Page: %@", [NSString stringWithFormat:@"%@",[viewControllers objectAtIndex:2] ]);
indexTest++;
return [viewControllers objectAtIndex:2];
break;
}
case 2:{
NSLog(@"No pages AFTER this current page %d", indexTest);
break;
}
default:{
NSLog(@"PROBLEM in viewAFTER, indexTest = %d!!!!", indexTest);
break;
}
}
}
return nil;
}
做這樣的事情,與indexTest
是int變量這增加了頁數爲每刷一下。
NUM_OF_PAGES is the total pages available for page controlling.
http://stackoverflow.com/questions/22795883/disable-bounce-effect-in-uipageviewcontroller – abhi1992
http://stackoverflow.com/questions/21798218/disable-uipageviewcontroller-bounce – abhi1992
看看這些答案 – abhi1992