Book Image

iOS Development with Xamarin Cookbook

By : Dimitrios Tavlikos (USD)
Book Image

iOS Development with Xamarin Cookbook

By: Dimitrios Tavlikos (USD)

Overview of this book

Table of Contents (22 chapters)
iOS Development with Xamarin Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Reproducing the page curl effect


In this recipe, we will create an app that displays content like that of a book with the help of the UIPageViewController class.

Getting ready

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.

How to do it...

Perform the following steps:

  1. 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...