2

アプリで動作するUIPageviewcontrollerを設定しました。ユーザーがページをめくったときに表示されるページの裏側をカスタマイズしたい。現在のデフォルトの動作では、フロントビューが40%程度で表示されています。裏面が指定したビューになるように設定することはできますか?

編集:多分私はビューの裏側を常に同じビューにしたいことを明確にする必要があります。たとえば、赤一色。ここで同じ質問があります影の背景を白から他の色に変更する方法

これは、脊椎の位置を決める方法で使用するコードです。私が読んだsetViewControllersメソッドのコメントで:

For transition style 'UIPageViewControllerTransitionStylePageCurl', if 'doubleSided' is 'YES' and the spine location is not 'UIPageViewControllerSpineLocationMid', two view controllers must be included, as the latter view controller is used as the back.

だから私がそうするなら:

-(UIPageViewControllerSpineLocation)pageViewController:
(UIPageViewController *)pageViewController spineLocationForInterfaceOrientation    (UIInterfaceOrientation)orientation
{
    UIViewController *currentViewController = self.pageViewController.viewControllers[0];
    UIViewController *backsideViewController = [[BackSideViewController alloc]init];
    self.pageViewController.doubleSided = YES;
    NSArray *viewControllers = @[currentViewController,backsideViewController];
    [self.pageViewController setViewControllers:viewControllers     direction:UIPageViewControllerNavigationDirectionReverse animated:YES completion:NULL];
    return UIPageViewControllerSpineLocationMax;
}

エラーが発生します: The number of provided view controllers (2) doesn't match the number required (1) for the requested spine location (UIPageViewControllerSpineLocationMax)

4

0 に答える 0