代码实现部分翻页效果的UIPageViewController

5
有没有可能在UIPageViewController的代码中部分卷曲页面。 我想向用户显示他可以更改页面,为此我想部分卷曲页面并将其放回(轻微向左滑动,然后向右滑动,这将是用户输入以获得此效果,但我想从代码中实现此目的)。

你找到了有用的东西吗? - Master Stroke
1个回答

0

你需要使用 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];
}

这完全不是我想要的。我想弯曲页面以反映它可以通过滑动手势进行更改。我不想使用一些动画来更改视图。 - Ertai
我也想要!UIViewAnimationTransitionCurlUp对于这个问题不是解决方案。 也许有一些方法可以模拟手势识别器进行转换? - akw

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接