【发布时间】:2011-11-21 21:52:02
【问题描述】:
我遵循How To Use the Three20 Photo Viewer by Ray Wenderlich 教程,它非常清晰且运行良好,我的问题是标题,如何在缩略图视图中启动 Three20 照片查看器?
我非常感谢任何指导或帮助。
【问题讨论】:
标签: iphone ios three20 thumbnails
我遵循How To Use the Three20 Photo Viewer by Ray Wenderlich 教程,它非常清晰且运行良好,我的问题是标题,如何在缩略图视图中启动 Three20 照片查看器?
我非常感谢任何指导或帮助。
【问题讨论】:
标签: iphone ios three20 thumbnails
您应该使用TTThumbsViewController 而不是TTPhotoViewController。在three20 TTCategory 示例应用中有一个很好的例子。
TTThumbsViewController 也使用照片源,因此您不必更改太多代码。您的照片查看器应该扩展 TTThumbsViewController 并实现 TTThumbsViewControllerDelegate 委托函数。
您可以在 viewDidLoad 函数中加载照片源:
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)viewDidLoad {
NSMutableArray* photos = [NSMutableArray array];
for (int i=kImagesCount;i>=1;i--) {
Photo* photo = [[[Photo alloc] initWithURL:[NSString stringWithFormat:@"bundle://%d.png", i]
smallURL:[NSString stringWithFormat:@"bundle://%dt.png", i]
size:CGSizeMake(400, 400)] autorelease];
[photos addObject:photo];
}
self.photoSource = [[PhotoSource alloc]
initWithType:PhotoSourceNormal
title:@"Select Picture"
photos:photos
photos2:nil];
}
【讨论】: