开发者

UIView Curled Corner animated effect

开发者 https://www.devze.com 2023-04-06 03:49 出处:网络
I want to create a special animation开发者_Go百科 effect applied to a UIView, similar to the famous curly effect but just for a top corner on a selected UIView.

I want to create a special animation开发者_Go百科 effect applied to a UIView, similar to the famous curly effect but just for a top corner on a selected UIView.

This the effect I want to accomplish (programmatically and animated of course):

UIView Curled Corner animated effect

The best approach I've found is W. Dana Nuon's.


Thank you CodaFi for pointing to that interesting public API, but it didn't really applied to my request.

The best I've found so far is CoreAnimation's CAFilter class, but it results to be "once again" a private class. http://iphonedevwiki.net/index.php/CAFilter#pageCurl It looks like you can really customize the pageCurl filter and animated it, but I wonder if Apple will reject an app doing in that. What do you think?


CAFilter is a private, undocumented class in iOS (and remains stubbornly so!), so any use of it would be rejected. There are, of course, transforms and little core graphics quirks that can be applied to the layer (in order to achieve an animated effect), however the easiest route, in my opinion, would be to make the curl an image that you could then overlay. It is, after all, nice and perfectly square:

UIView Curled Corner animated effect

0

精彩评论

暂无评论...
验证码 换一张
取 消