我正在创建一个 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];
}
}