TTPhotoViewController:如何显示小图像
我在 Three20 google group 上发布了这个问题,但没有得到任何回复。所以我想我试试这个论坛。我正在使用 TTPhotoViewController 来显示照片。我正在遵循 Three20 示例项目中给出的示例代码:TTCatalog/PhotoTest1Controller.m。就我而言,某些图像小于 (320,480)。我面临的问题是,当我的形象 200*300,然后 TTPhotoViewController 在加载时将其大小重新调整为全屏,这会扭曲图像。我想知道是否有一种方法可以告诉 TTPhotoViewController 以实际大小显示图像而不是调整其大小。
我唯一改变的是 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 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:@"http://test//test.jpg"
size:CGSizeMake(200, 300)
caption:@"This is a caption."]
autorelease],
nil]
photos2:nil] autorelease];
}
I will appreciate your help.
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需将大小设置为 CGSizeZero,它应该默认为实际图像尺寸
Just set the size to CGSizeZero and it should default to the actual image dimensions