开发者

iphone - sliding in animation

I have a UIView that I would like to animate into the screen in the following way:

Imagine you are looking a table top and you have an envelop and over that envelop a box. The box covers almost all the envelop, but you see a small envelop border that is not covered by the box. The animation would be the envelop sliding down until it is fully visible.

I could simple animate this, but I would have to have another view with the box image, over the envelop, so it will cover the envelop. My idea is to make this without this box view. If I was using an application like Photoshop to animate this, I would simply make the matte (or mask) fixed and make a bl开发者_StackOverflow中文版ack rectangle where I want the envelop to be invisible, that is, to simulate as it was covered by the box. Then, if I keep the mask fixed, I can animate the image and it will appear as it is coming from below the box, but in fact it is coming from a region where the matte is black (image is invisible) to a region where the mate is white (image is visible).

Is it possible to do this on iOS?

Can I mask a UIImageView or layer and animate the layer keeping its mask fixed?

Check the slide down effect here in this page http://madrobby.github.com/scriptaculous/combination-effects-demo/

It will give you and idea of what I mean...

thanks


Set the clipsToBounds-property of the 'mask view' to YES. Add your 'content view' as subview to the 'mask view' and animate the frame of the 'content view' so that it slides into the mask.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜