开发者

TTPhotoViewController: How to show small images

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:@"Plant Photos"
                 photos:[NSArray arrayWithObjects:[[[MockPhoto alloc]
                 initWithURL:@"http://test//test.jpg"
                 smallURL:@"开发者_StackOverflow中文版http://test//test.jpg"
                 size:CGSizeMake(200, 300)
                 caption:@"This is a caption."]
                 autorelease],
                 nil]
                 photos2:nil] autorelease];

   }

I will appreciate your help.

Thanks


Just set the size to CGSizeZero and it should default to the actual image dimensions

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜