Tutorial :Image overlapping in photo viewer on three20 framework?


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?



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.


Just by setting line 135 of TTPhotoView.m to

self.contentMode = UIViewContentModeScaleAspectFit

will help.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Next Post »