“我们的选择”如何应用程序是否可以通过捏合和放大来查看内容部分?
该应用程序可以在这里看到:http://pushpoppress.com/ourchoice/。我感兴趣的是他们可以随意捏住底部的缩略图以放大全图的部分。复制这样的效果会很有趣。
大家有什么想法吗?
The said app can be seen here: http://pushpoppress.com/ourchoice/. What interests me is the part where they can freely pinch the thumbnails at the bottom to enlarge to full view. Would be interesting to replicate such effect.
Any ideas guys?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要旋转图像:
导入math.h
在touchesbegan中
:找到firsttouch、secondtouch等,然后:
float startdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
触动:
再次找到firsttouch、secondtouch,然后:
float newdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
image.transform = CGAffineTransformMakeRotation(newdirection-startdirection);
To rotate the image:
import math.h
in touchesbegan: find firsttouch, secondtouch, etc.
then:
float startdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
in touchesmoved:
find firsttouch, secondtouch again, then:
float newdirection = tanh((firsttouch.y-secondtouch.y)/(firsttouch.x-secondtouch.x));
image.transform = CGAffineTransformMakeRotation(newdirection-startdirection);
您可以使用touchesBegan,但枚举触摸并使用点之间的距离、它们的位置等来操纵UIImageView的大小和位置。然后如果距离足够大,它可以自动跳转到全屏。
You could use touchesBegan but enumerate the touches and use the distance between the points, their positions, etc. to manipulate the size and position of a UIImageView. Then if the distance is large enough it could automatically jump to full screen.