Zoom the page of a view based iOS App

北战南征 提交于 2019-12-11 09:07:36

问题


I have a view based application. I have to add features like pinch zoom and double tap to zoom the page(UIView) in the iOS application. Its easy to zoom a UIScrollview.

I should create a framework which has the option to pan and zoom the entire app. How do a achieve to zoom a view based application? I welcome your ideas!


回答1:


The best way to do it, is to put the entire app components in one scrollview and use the zooming of the control.

The other way which is not as stable as the first one, is to scale all objects inside the UIVIEW larger or smaller depending on the pinch zoom, but keep in mind that scaling will affect the look of the entire application, so you need to adjust the position of each object accordingly.




回答2:


You can create your own zoom functionalities in a UIView by using UIGestureRecognizer and CALayer transform property. Ex. scaling and change the anchorPoint base on the focus point.



来源:https://stackoverflow.com/questions/17717491/zoom-the-page-of-a-view-based-ios-app

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