UIScrollView 放大时将图像移动到左上角 [英] UIScrollView moves image to the top left corner when zooming in

查看:48
本文介绍了UIScrollView 放大时将图像移动到左上角的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

看这个问题:防止 UIScrollView 从移动内容到顶部-离开,我遇到了确切的问题.

Looking at this question: Prevent UIScrollView from moving contents to top-left, i'm having the exact issue.

我正在使用本教程:http://cocoadevblog.heroku.com/iphone-tutorial-uiimage-with-zooming-tapping-rotation

回到类似的问题,如果我禁用 UIScrollViewPanGestureRecognizer,我将无法再平移缩放的图像.

Back to the similar question, if i disable the UIScrollViewPanGestureRecognizer, i'm not able to pan the zoomed image anymore.

我在 UIScrollView 中有一个 UIImageView,我也希望能够缩放和平移图像.

I have a UIImageView within a UIScrollView, and i want to be able to zoom and pan the image as well.

在放大时如何禁用移动到左上角的内容?

How can i do tho disable the contents moving to the top left corner when zooming in?

推荐答案

似乎我解决了在大小检查器 \ 属性检查器中调整我的 UiScrollView 自动调整大小和原点的问题.我取消选中 Paging Enabled 并且神奇发生了.

Seems i solved tweaking my UiScrollView Autosizing and Origin in the Size inspector \ Attributes inspector. I unchecked Paging Enabled and the magic happened.

这篇关于UIScrollView 放大时将图像移动到左上角的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆