Three20 框架上的照片查看器中的图像重叠?

发布于 2024-09-09 05:13:25 字数 128 浏览 2 评论 0原文

我刚刚集成了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

﹎☆浅夏丿初晴 2024-09-16 05:13:25

如果图像重叠,则当您将它们包含在照片视图控制器中时,您没有正确设置它们的大小。您必须(不幸的是)告诉 Three20 确切的大小,以便它知道如何在滚动视图的分页模式下显示它们。

确保你调整的缩略图大小与他的相似(大约 100 像素高或宽,具体取决于它是纵向还是横向)

[[[MockPhoto alloc]
  initWithURL:@"http://farm4.static.flickr.com/3444/3223645618_13fe36887a_o.jpg"
  smallURL:@"http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg"
  size:CGSizeMake(320, 480) // see how he sets the size here for each and every photo? this is crucial
  caption:@"These are the wood tiles that we had installed after the accident."] autorelease],

如果你查看缩略图,它是 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)

[[[MockPhoto alloc]
  initWithURL:@"http://farm4.static.flickr.com/3444/3223645618_13fe36887a_o.jpg"
  smallURL:@"http://farm4.static.flickr.com/3444/3223645618_f5e2fa7fea_t.jpg"
  size:CGSizeMake(320, 480) // see how he sets the size here for each and every photo? this is crucial
  caption:@"These are the wood tiles that we had installed after the accident."] autorelease],

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.

初熏 2024-09-16 05:13:25

只需将 TTPhotoView.m 的第 135 行设置为

self.contentMode = UIViewContentModeScaleAspectFit

就会有所帮助。

Just by setting line 135 of TTPhotoView.m to

self.contentMode = UIViewContentModeScaleAspectFit

will help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文