Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/102.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Iphone UIPageViewController代码的部分卷曲_Iphone_Ios_Xcode_Uipageviewcontroller - Fatal编程技术网

Iphone UIPageViewController代码的部分卷曲

Iphone UIPageViewController代码的部分卷曲,iphone,ios,xcode,uipageviewcontroller,Iphone,Ios,Xcode,Uipageviewcontroller,是否有可能使用UIPageViewController从代码中部分卷曲页面。我想向用户展示他能够更改页面,为了做到这一点,我想部分卷曲页面并将其放回原处(轻轻向左然后向右滑动,这将是用户的输入以获得此效果,但我希望它来自代码)。您需要使用UIViewAnimationTransitionCurlUp。检查下面的示例 - (void)handleSwipe:(UISwipeGestureRecognizer *)sender { if(sender.state == UIGestureRecog

是否有可能使用UIPageViewController从代码中部分卷曲页面。我想向用户展示他能够更改页面,为了做到这一点,我想部分卷曲页面并将其放回原处(轻轻向左然后向右滑动,这将是用户的输入以获得此效果,但我希望它来自代码)。

您需要使用
UIViewAnimationTransitionCurlUp
。检查下面的示例

- (void)handleSwipe:(UISwipeGestureRecognizer *)sender {

if(sender.state == UIGestureRecognizerStateEnded) {
    [UIView beginAnimations:nil context:NULL];
    [UIView setAnimationDuration:0.3];
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:window cache:YES];

    [self.view addSubview:[newView view]];
    [oldView removeFromSuperview];

    [UIView commitAnimations];
   }                  
}
- (void)createGestureRecognizers:(UIView *) target {
UISwipeGestureRecognizer *rightSwipeRecognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipe:)];

[rightSwipeRecognizer setDirection:(UISwipeGestureRecognizerDirectionRight)];
[target addGestureRecognizer:rightSwipeRecognizer];
[rightSwipeRecognizer release];
}

这根本不是我想要的。我想弯曲页面以反映它可以通过滑动手势进行更改。我不想用一些动画来改变视图。我也想要这个!UIViewAnimationTransitionUrlUp无法解决此问题。也许有什么方法可以在过渡时伪造手势识别器?你发现有用的东西了吗?