开发者

UIViewController Image Touch Events

开发者 https://www.devze.com 2023-03-09 05:48 出处:网络
I have an开发者_StackOverflow中文版 image in a UIViewController which can be zoomed in and out. What I want is to include some areas of the image where the user can tap and more information shows up o

I have an开发者_StackOverflow中文版 image in a UIViewController which can be zoomed in and out. What I want is to include some areas of the image where the user can tap and more information shows up on that screen.

I was wondering how I should approach this?

Note, the image must be able to zoom in and out; and the areas where they touch would increase/decrease according to the image zoom. (If that is possible).


use UIPinchGesture Recognizer and UITabGesture Recognizer


You can use a UIScrollView for this. If you want certain areas to have info overlays like the map, you can store a list of "hot spots" and test touch events against the list and see if that area has been tapped.

0

精彩评论

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