UIImageView的折叠/curl边缘
我需要折叠/展开UIImageView的边缘以标记为最喜欢的。 我search了多个网站,但没有发现任何关于它。 我附加了一些示例图像,如果可能的话,还带有animation效果。
谢谢!!
一种方法是为animation视图使用OpenGL。 有一个很好的库,称为XBPageCurl
但是,通过为curl效果创build蒙版并在过渡到animation效果的同时对其进行animation处理,可以实现更轻量级的解决scheme。 这是它的样子
[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
可以用UIViewController
的presentModalViewController:animated:
完成,并将modalTransistionStyle
设置为UIModalTransitionStylePartialCurl
。 看苹果的文档 。