Zoom the page of a view based iOS App

2019-08-02 11:55发布

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!

2条回答
三岁会撩人
2楼-- · 2019-08-02 12:41

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.

查看更多
够拽才男人
3楼-- · 2019-08-02 12:51

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.

查看更多
登录 后发表回答