In this recipe, we will create an app that displays content like that of a book with the help of the UIPageViewController
class.
Create a new Single View Application in Xamarin Studio and name it BookApp
. Add another controller to the project and name it Page
. Configure the appearance of the Page
controller however you like. In the source code for this recipe, the contains a UIImageView
and a UILabel
.
Perform the following steps:
Enter the following code in the
BookAppViewController
class:private UIPageViewController pageViewController; private int pageCount = 3; public override void ViewDidLoad () { base.ViewDidLoad (); Page firstPage = new Page(0); this.pageViewController = new UIPageViewController(UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min); this.pageViewController.SetViewControllers(new UIViewController[] { firstPage }, UIPageViewControllerNavigationDirection...