开发者

Mask a whole animation happening in a UIImageView

开发者 https://www.devze.com 2022-12-08 00:40 出处:网络
I need to mask a whole animation that takes place in a UIImageView. I tried subclassing the UIImageView and doing the masking in its drawRect call but that doesn\'t get called on every frame of the an

I need to mask a whole animation that takes place in a UIImageView. I tried subclassing the UIImageView and doing the masking in its drawRect call but that doesn't get called on every frame of the animation as I expected (it doesn't get call开发者_如何学运维ed at all actually) even though the animation plays fine.

Anyone has any experience on this?


Since the CIFilter public API is missing on iPhone OS, there's no way to do compositing using UIView or CALayer.

This means that the answer is: You cannot mask the contents of UIImageView, animated or not.

I've filed a radar bug request because I feel that the addition of the CIFilter API would be a great enhancement to Cocoa Touch and expand the possibilities of UIView/CALayer based UI design a lot. At the moment, if you want to do compositing on the iPhone, you have to use Quartz (slow) or OpenGL (doing everything yourself).

If you agree on the usefulness of CIFilters for iPhone OS, please consider filing a request on radar. The more requests, the sooner Apple will care about it.

0

精彩评论

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