0

我正在创建一个 ePub 阅读器,它可以读取 ePub 文件。我想实现类似于实体书的页面滑动效果。例如.

这是什么动画?这不起作用:

- (void)loadPage{

[UIView beginAnimations:nil context:nil]; 
    //change to set the time 
    [UIView setAnimationDuration:1]; 
    [UIView setAnimationBeginsFromCurrentState:YES]; 
    [UIView setAnimationTransition:UIViewAnimationTransitionCurlUp forView:self.view cache:YES]; 

    // do your view swapping here 
    [UIView commitAnimations];
}

滑动时:

- (void)swipeRightAction:(id)ignored
{
    NSLog(@"Swipe Right");
    if (_pageNumber>0) {

        _pageNumber--;
        [self loadPage];
    }

}

- (void)swipeLeftAction:(id)ignored
{
    NSLog(@"Swipe Left");

    if ([self._ePubContent._spine count]-1>_pageNumber) {

        _pageNumber++;
        [self loadPage];
    }

}
4

1 回答 1

1

我对第三方 api 做了同样的事情。您可以从以下网址获取参考

https://github.com/jemmons/PageCurl

https://github.com/xissburg/XBPageCurl

https://github.com/brow/leaves

于 2012-05-17T05:46:41.187 回答