我正在工作的iPhone
应用程序,我有5-6组图像。我想改变图像使用页面卷曲动画,如iBook
,用户可以滑动页面,根据手指移动与页面卷曲动画。我想在iPhone上实现相同的动画。是否有任何方法可以不使用私有库或UIPageViewController
,或者如果有任何可用的示例来实现这一点?
除了谷歌搜索之外,我还得到了一些类似于以下内容的词条:
树叶
纸堆
XBPagecurl
分页
没有得到多少帮助。
发布于 2016-08-30 09:13:30
请不要去寻求确切的解决方案,上面的解决方案会给你一些想法,你可以对此进行研究,并扩大它的范围。这样你学得越多,你玩得越多。我有建议的博客请浏览,浏览它。
发布于 2016-08-30 09:26:36
在视图中添加像这样的滑动手势
UISwipeGestureRecognizer *gesture = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(curlAnimation)];
[gesture setDirection:UISwipeGestureRecognizerDirectionLeft];
[self.view1 addGestureRecognizer:gesture];
使用以下代码片段制作curl动画
- (void)curlAnimation
{
[UIView animateWithDuration:1.0
animations:^{
CATransition * animation = [CATransition animation];
[animation setDelegate:self];
[animation setDuration:1.2f];
animation.startProgress = 0.0;
animation.endProgress = 1;
[animation setTimingFunction:UIViewAnimationCurveEaseInOut];
[animation setType:@"pageCurl"];
[animation setSubtype:@"fromRight"];
[animation setRemovedOnCompletion:NO];
[animation setFillMode: @"extended"];
[animation setRemovedOnCompletion: NO];
[[self.view1 layer] addAnimation:animation
forKey:@"pageFlipAnimation"];
}
];
}
您可以在此方法中设置"fromLeft“代替fromRight,用于从左到右动画。
快乐编码..。
https://stackoverflow.com/questions/39222887
复制相似问题