add UIButton as subview of UIWebView and resize it when zoom

我的未来我决定 提交于 2019-12-05 12:43:07

If you're targeting iOS 5 and higher you can access scrollView property from UIWebView instance and become its delegate.

We are interested in scrollView:zoom* methods. Basic idea is:

1) On -scrollViewDidZoom: you're positioning the button according to scrollView.zoomScale with taking into account currentButtonFrame;

2) On -scrollViewDidEndZooming:withView:atScale: you're updating currentButtonFrame.

Check sample project here.

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