Zoomable Graphics

对着背影说爱祢 提交于 2019-12-14 03:19:42

问题


I am trying to draw zoomable graphics onto the screen. I currently have a UIView inside of a ScrollView and I'm wondering what the best way is to go about handling/implementing zooming of the graphics I've drawn on the screen.


回答1:


You'll probably want to use something along the lines of what I describe in my answer here.

During the pinch-zooming event, a transform will be applied to your UIView, which will zoom the content but will lead to blurring. Once the zooming event is finished, use the -scrollViewDidEndZooming:withView:atScale: delegate method to determine the new scale factor and resize and re-render your UIView appropriately. If you're doing your drawing using Core Graphics within the -drawRect: method of your UIView, this should be pretty easy to manage.



来源:https://stackoverflow.com/questions/5889517/zoomable-graphics

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!