我需要摺疊/展開UIImageView的邊緣以將其標記爲收藏夾。我搜索了多個網站,但沒有發現任何關於它的內容。 我附上了一些示例圖像,並且如果可能的話,還帶有動畫效果。UIImageView的摺疊/捲曲邊緣
謝謝!
我需要摺疊/展開UIImageView的邊緣以將其標記爲收藏夾。我搜索了多個網站,但沒有發現任何關於它的內容。 我附上了一些示例圖像,並且如果可能的話,還帶有動畫效果。UIImageView的摺疊/捲曲邊緣
謝謝!
做到這一點的一種方法是動畫視圖使用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
可以UIViewController
的presentModalViewController:animated:
進行,並設置modalTransistionStyle
到UIModalTransitionStylePartialCurl
。見apple's docs。
啓,感謝,但褶皺效果應該是對的UIImageView的任何邊緣微小的,所以我不能使用默認動畫。 – mhergon