照片查看器(具有缩放、平移、缩放等功能)? Three20 的替代方案
我有一个带有几张图片的应用程序。如果用户点击其中之一,我希望他能够缩放、平移、缩放等。我不需要像 Three20 这样的东西。首先,我从应用程序内的文件加载图像,其次我不需要“库”功能(在网格中显示所有图像>像 Photos.app 一样)。所以我只需要左图片中的部分...
如何我这样做?有没有“样本课程”或教程?
预先非常感谢!
I have an app with a few pictures. If the user clicks on one of them, I want him to be able to zoom, pan, scale and so on. I don't need something like Three20. First of all, I'm loading the images from file inside the app, second I don't need the "library" feature (that displays all the images in a grid > like the Photos.app). So I only need the part in the left picture...
How can I do that? Is there any "sample class" or tutorial?
Thanks a lot in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
UIScrollView 不仅支持滚动,还支持放大和缩小,事实上,它是 webViews 和 tableViews 等事物的超类。
这是将 UIImageView 放入 UIScrollView 的问题 并使 contentSize 匹配,并启用缩放(默认情况下最大/最小缩放为 1.0,将其设置为其他值允许缩放)。
The UIScrollView supports not only scrolling, but also zooming in and out, in fact, it's the super class of things like webViews and tableViews.
It's a matter of fitting an UIImageView inside an UIScrollView and make the contentSize match, and enable zooming (maximum/minimum zooming is 1.0 by default, setting it to something else allows zooming).
查看Nibmus 项目,他们有一个不错的照片控制器http://jverkoey.github.com/nimbus/group___nimbus_photos.html,这听起来是正是您正在寻找的。
check out the Nibmus Project, they have a nice photos controller http://jverkoey.github.com/nimbus/group___nimbus_photos.html, which sounds to be exactly what you're looking for.