TTPhotoViewController: How to show small images

Posted by Sali on Stack Overflow See other posts from Stack Overflow or by Sali
Published on 2010-06-05T09:08:32Z Indexed on 2010/06/05 9:12 UTC
Read the original article Hit count: 184

Filed under:

Hi,

I posted this question on Three20 google group but did not get any response. So I thought I try this forum. I am using TTPhotoViewController to display photos. I am following sample code given in Three20 sample project: TTCatalog/PhotoTest1Controller.m. In my case some of the images are less than (320,480). The problem which I am facing is that when my image is 200*300 then TTPhotoViewController re-sizes it to full screen on load which distorts the image. I was wondering if there is a way to tell TTPhotoViewController to display image in its actual size and not to resize it.

The only thing which I have changed is viewDidLoad function in PhotoTest1Controller.m.

  • (void)viewDidLoad { self.photoSource = [[[MockPhotoSource alloc] initWithType:MockPhotoSourceNormal title:@"Photo 1" photos:[NSArray arrayWithObjects:[[[MockPhoto alloc] initWithURL:@"http://test/test.jpg" smallURL:@"http://test/test.jpg" size:CGSizeMake(200, 300) caption:@"This is a caption."] autorelease], nil] photos2:nil] autorelease];

}

I will appreciate your help.

Thanks

© Stack Overflow or respective owner

Related posts about three20