UIImageView的折叠/卷曲边缘

时间:2012-09-19 13:45:47

标签: iphone ios uiimageview edge fold

我需要折叠/展开UIImageView的边缘以标记为收藏夹。我搜索了多个网站,但没有发现任何相关信息。 我附上了一些示例图像,如果可能的话,还附带动画效果。

谢谢!

Fold Fold 2

2 个答案:

答案 0 :(得分:1)

一种方法是使用OpenGL动画视图。有一个很好的库,名为XBPageCurl

但是,您可以通过为卷曲效果创建遮罩并在转换到视图时为视图设置动画来实现更轻松的解决方案。这就是它的样子

[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:0.3];

UIImage *maskedImage = [yourImage imageMaskedWithImage:yourMask];
[yourImageView setImage:maskedImage];

[UIView commitAnimations];

要了解如何屏蔽图像,请查看http://mobiledevelopertips.com/cocoa/how-to-mask-an-image.html

答案 1 :(得分:0)

可以使用UIViewController的{​​{1}}并将presentModalViewController:animated:设置为modalTransistionStyle。请参阅apple's docs

相关问题