简体   繁体   English

TTPhotoViewController:如何显示小图像

[英]TTPhotoViewController: How to show small images

I posted this question on Three20 google group but did not get any response. 我将这个问题发布在Three20谷歌论坛上,但没有得到任何回应。 So I thought I try this forum. 所以我想我尝试这个论坛。 I am using TTPhotoViewController to display photos. 我正在使用TTPhotoViewController来显示照片。 I am following sample code given in Three20 sample project: TTCatalog/PhotoTest1Controller.m. 我正在遵循Three20示例项目中给出的示例代码:TTCatalog / PhotoTest1Controller.m。 In my case some of the images are less than (320,480). 在我的情况下,某些图像小于(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. 我面临的问题是,当我的图像尺寸为200 * 300时,TTPhotoViewController会在加载时将其大小调整为全屏,这会使图像失真。 I was wondering if there is a way to tell TTPhotoViewController to display image in its actual size and not to resize it. 我想知道是否有一种方法可以告诉TTPhotoViewController以其实际大小显示图像而不调整其大小。

The only thing which I have changed is viewDidLoad function in PhotoTest1Controller.m. 我唯一更改的是PhotoTest1Controller.m中的viewDidLoad函数。

- (void)viewDidLoad { 
     self.photoSource = [[[MockPhotoSource alloc]
                 initWithType:MockPhotoSourceNormal
                 title:@"Plant Photos"
                 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 谢谢

只需将大小设置为CGSizeZero,它应该默认为实际图像尺寸

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM