开发者

iPhone/iPad Pan, Pinch and Rotate a view simultaneously

I'm trying to recreate the behaviour of the photos app, where you can pan, pinch and rotate simultaneously. I have the basics working, but I'm stuck on something.

For the pan, I offset the centrepoint of the view by the translation amount. This is working well.

For the pinch and rotate I'm applying an affine transfor开发者_运维知识库m to the view. This is also working well.

The problem is when I pan (ie. move the subview), and then pinch or rotate - the affine transform seems to get applied using the old centre point of the view. I though that it should use the current centre point as the transform origin - as I'm updating the centrepoint when I pan I though that this should work. Instead of a rotation about the centrepoint of the subview, I get a rotational movement about the original centrepoint.

How do I correct this ? It's clearly possible to combine these three gestures intuitively, as the photos app does it successfully.

I tried using an affine translation for the pan, but the effect was the same.


Apple have confirmed this appears to be a bug with the way that gesture recognisers are working in iPhone OS 3.2. I have filed a bug report.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜