开发者

How to implement pinch to zoom and flick with momentum for a drawing (graph) Core Graphics app?

开发者 https://www.devze.com 2023-03-15 00:13 出处:网络
In my app, I drew a开发者_StackOverflow社区 graph using Core Graphics (inside a view, inside a view). Not a graphing calc app though, it graphs patient data and marks it every six months, and it is la

In my app, I drew a开发者_StackOverflow社区 graph using Core Graphics (inside a view, inside a view). Not a graphing calc app though, it graphs patient data and marks it every six months, and it is larger than the screen, so the user needs to have some way to move around. I was wondering if there is an easy way to implement pinch to zoom, or to flick with momentum. I was planning on just using UITouch to get notified when these actions were performed, but it doesnt really give you a lot of information. For example, all you get with the pinch to zoom is the ratio that they have zoomed, and all you get with the flick is the direction that they have flicked. So, I was just going to implement basic flicks without momentum, and simple pinch to zoom without being able to move around too.

But I figured I would ask here first, to see if anyone has a better idea about how to do this (easily).

EDIT: I found lots of places that tell you how to do this with photos, but none with core graphics or something like that, thanks.


I ended up using a UIScrollView, which implements pinch to zoom, and flick automatically (well, almost).

0

精彩评论

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

关注公众号