arsena
arsena

Reputation: 1975

Change UIPageViewController Flip Animation

I have an UIPageViewController that changes ViewControllers with page flip animation on default

enter image description here

Is it possible to replace this animation with simple slide-in/slide-out one? Like Android ViewPager does for example.

Here is my UIPageViewController initialization:

var pageViewController = new UIPageViewController();
        pageViewController.DataSource = new InfoViewControllerDataSource(this, _pageTitles);
        pageViewController.SetViewControllers(new UIViewController[] { Pages[0] }, UIPageViewControllerNavigationDirection.Forward, false, null);
        pageViewController.View.Frame = new CGRect(0, _toolbar.Frame.Bottom, this.View.Frame.Width, this.View.Frame.Size.Height);
        AddChildViewController(this.pageViewController);

Upvotes: 7

Views: 8219

Answers (2)

UdayaLakmal
UdayaLakmal

Reputation: 4223

Can do within the storyboard : Page view Controller

Navigation : Horizontal

Transition Style : Scroll

enter image description here

Upvotes: 4

Ashik
Ashik

Reputation: 1259

You can do it from the Interface builder. Change the Transition style property to Scroll. If you want to do it programmatically, transitionStyle is a read-only property. It can only be done by this method

pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.Scr‌​oll, UIPageViewControllerNavigationOrientation.Horizontal)

Upvotes: 15

Related Questions