jeudi 5 mars 2015

Add Controls to UIPageViewController

I need to add some buttons to my UIPageViewController. I followed this tutorial and you will notice that at the bottom there is a button below the dots. How do I accomplish a similar thing? I need to add 3 buttons to the view.


Tutorial: http://ift.tt/19i0eKt


Thanks in advance, and sorry if I have missed something obvious. I have searched quite a bit.



- (void)viewDidLoad
{
[super viewDidLoad];

_pageImages = @[@"Step1.png", @"Step2.png", @"Step3.png"];

self.mainStoryboard = [UIStoryboard storyboardWithName:@"MainStoryboard_iPhone" bundle:nil];

self.pageViewController = [self.mainStoryboard instantiateViewControllerWithIdentifier:@"PageViewController"];

self.pageViewController.dataSource = self;

RTMPageContentViewController *startingViewController = [self viewControllerAtIndex:0];
NSArray *viewControllers = @[startingViewController];
[self.pageViewController setViewControllers:viewControllers direction:UIPageViewControllerNavigationDirectionForward animated:YES completion:nil];

self.pageViewController.view.frame = CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height);

[self addChildViewController:_pageViewController];
[self.view addSubview:_pageViewController.view];
[self.pageViewController didMoveToParentViewController:self];
}



Aucun commentaire:

Enregistrer un commentaire