NSInternalInconsistencyException from UIPageViewController on rotation

I am on Monotouch 5.2.6 and iOS SDK 5.0.1.

I have a UIPageViewController which is a child container of another view controller. It is created as follows:

pageViewController = new UIPageViewController (UIPageViewControllerTransitionStyle.PageCurl, UIPageViewControllerNavigationOrientation.Horizontal, UIPageViewControllerSpineLocation.Min);
    this.AddChildViewController (pageViewController);
    pageViewController.DidMoveToParentViewController (this);
    this.viewCurrentMode.AddSubview (pageViewController.View);

If I rotate the device (Simulator), I get this exception in UIApplication.SendEvent():

Objective-C exception. Name: NSInternalInconsistencyException Reason: the number of view controllers provided (1) does not match the required amount (2) for the requested spine location (UIPageViewControllerSpineLocationMid)

The location of the spine is NOT the "middle", but the "min". Any ideas?

+5
source share
2 answers

, UIPageViewController "" . GetSpineLocation:

public override UIPageViewControllerSpineLocation GetSpineLocation (UIPageViewController pageViewController, UIInterfaceOrientation orientation)
{

    //return spine location according to interface orientation and whatever
    //criteria you prefer

}

GetSpineLocation (MonoTouch heaven!):

pageViewController.GetSpineLocation = (p, o) => return <spinelocation>;

, . , native pageViewController:spineLocationForInterfaceOrientation: "Mid", ( Apple). , , .

+4

, UIPageViewControllerSpineLocation Apple documentation.

, Dimitris , , ( ) UIPageViewControllerSpineLocation.Mid, (.. UIPageViewController.GetSpineLocation ).

, , , case. ( ), .

0

All Articles