ios - Navigation with UIPageViewController -


Sorry for my english :))

I use UIPageViewController to navigate between pages Please. The first page is the table of contents for all pages (integer) index {BaseArtViewController * pageViewController = [self-viewControllerAtIndex: index - (zero) flipToPage

 : When I click on the element in the table of contents , I try to change the page with the above method]; NSArray * viewControllers = [NSArray arrayWithObjects: pageViewController, zero]; If (currentIndex & lt; index) {[self.pageController setViewControllers: viewControllers Direction: UIPageViewControllerNavigationDirectionForward Animated: Yes Completion: Zero]; } Else if (currentIndex> index) {[self.pageController setViewControllers: viewControllers Direction: UIPageViewControllerNavigationDirectionReverse Animated: Yes Completion: Zero]; } // controller aspect for change page NSArray * subviews = self.pageController.view.subviews; UIPageControl * thisControl = Zero; (Intuit I = 0; I & lt; [Subview Count]; i ++) {If ([SubViews Object AutoAndX: I] Hackandoff Class: [UIPAZ Control Class]]) {This Control = (UIPAZ Control *) [SubViews ObjectAddindex: I]; ThisControl.currentPage = Index; }}   

}

} This job is, but not properly, there is no transition between access to content table and page.

When I reach the click page, if I try to use the previous page, for example I am on page 4, I want to go to page 3 but I page 0 (Table of contents ) I want to come back. Do you know any solution or someone can tell me how to do ???

Thanks for the help!

thanks for viewController {NSUInteger index = [ (BaseArtViewController *) view controller index]; NSLog (@ "before index:% i", index); If (index == 0) return zero; // Change the index index ;; // Stock Current Index currentIndex = Index; Return [Self View Controller Import Index: Index]; } - (UIViewController *) pageViewController: (UIPageViewController *) pageViewController viewControllerAfterViewController: (UIViewController *) viewController {NSUInteger Index = [(BaseArtViewController *) viewController index]; NSLog (@ "After Index:% i", Index); // Change index index ++; If (index == nbPages) return zero; // Stock Current Index currentIndex = Index; Return [Self View Controller Import Index: Index]; }

and to get started:

  - (zero) init rendering {self.pageController = [[UIPageViewController alloc] initWithTransitionStyle: UIPageViewControllerTransitionStyleScroll Navigation Orientation: UIPageViewControllerNavigationOrientationHorizontal Option: zero]; Self.pageController.dataSource = self; [[Self. Page controller view] setframe: [[see itself] limitations]]; BaseArtViewController * Initial ViewController = [Auto ViewerAdWords: Current Index]; NSArray * viewControllers = [NSArray arrayWithObject: initialViewController]; [Self. Page Controller SetView Controller: Visual Controller Direction: UIPageViewControllerNavigationDirectionForward Animated: Not Complete: Zero]; [Self addChildViewController: self.pageController]; [[See itself] Adsview: [self Page controller view]]; [Self. Page Controller did the FrontPoint View Controller: Self]; }   

base class: BaseArtViewController.h #import

  @interface BaseArtViewController: UIViewController @property (assign, non-fixed) NSInteger index ; @protect (assign, nanatomic) NSArray * tab; @end   

Base class: BaseArtViewController.m

  #import "BaseArtViewController.h" @ Interface BaseArtViewController () @end @implementation BaseArtViewController - (ID) initWithNibName: (NSString *) nibNameOrNil bundle: (NSBundle *) nibBundleOrNil {self = [super initWithNibName: nibNameOrNil bundle: nibBundleOrNil]; If (auto) {// custom initialization} return itself; } - (zero) viewDidoadload [[Super Viewedload]; // Setup an additional after loading the view NSLog (@ "index page:% i", auto.indac); } - (zero) did risive memorianising [[super dysrhymmy warning]; // Any resource settlement which can be reproduced. } @end    

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -