Three20 框架上的照片查看器中的图像重叠?
我刚刚集成了 Three20 框架的照片查看器。它工作正常,但有时图像重叠,这种情况仅发生在缩略图图像上,而原始图像已完美加载。直到原始图像加载为止,此时图像是重叠的。
有人遇到过这个问题并有解决办法吗?
谢谢
I just integrated the photo viewer from three20 framework. Its working fine but some time images are overlapping, that ia happening only for thumnail image while original image is perfectly loaded. Till the original image loaded , at that point of time images are overlapping.
Did any one face this problem and have any solution for that?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果图像重叠,则当您将它们包含在照片视图控制器中时,您没有正确设置它们的大小。您必须(不幸的是)告诉 Three20 确切的大小,以便它知道如何在滚动视图的分页模式下显示它们。
确保你调整的缩略图大小与他的相似(大约 100 像素高或宽,具体取决于它是纵向还是横向)
如果你查看缩略图,它是 67 像素 x 100 像素: http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg
如果你看常规照片,它是 320 像素 x 480 像素。 :http://farm4.static.flickr.com/3444/3223645618_13fe36887a_o.jpg
这是两个独立的文件, Three20 代码不会根据较大的照片为您创建缩略图。您必须手动执行此操作,或者对他用来为您执行此操作的任何容器类进行子类化。
If images are overlapping, you are not correctly setting their size when you are including them in the photo view controller. You have to (unfortunately) tell three20 the exact size so it knows how to display them in paging mode of the scrollview.
Make sure you are resizing your thumbnails similar sizes to his (somewhere around 100 pixels tall or wide, based on if it's in portrait or landscape)
If you look at the thumbnail, it is 67pixels by 100pixels: http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg
If you look at the regular photo, it is 320pixels by 480pixels. : http://farm4.static.flickr.com/3444/3223645618_13fe36887a_o.jpg
These are two independent files, the three20 code does not create the thumbnail for you based on the larger photo. You must do this manually or subclass whatever container class he uses to do it for you.
只需将 TTPhotoView.m 的第 135 行设置为
self.contentMode = UIViewContentModeScaleAspectFit
就会有所帮助。
Just by setting line 135 of TTPhotoView.m to
self.contentMode = UIViewContentModeScaleAspectFit
will help.