How to Start Three20 Photo Viewer in Thumbnail view?
Asked Answered
D

1

8

I followed How To Use the Three20 Photo Viewer by Ray Wenderlich tutorial it was very clear and working perfectly, my question as the title, How to Start Three20 Photo Viewer in Thumbnail view?

I am greatly appreciative of any guidance or help.

Dodwell answered 21/9, 2011 at 12:16 Comment(0)
H
2

You should use TTThumbsViewController instead of TTPhotoViewController. There's a good example of it in three20 TTCategory sample app.

TTThumbsViewController also uses a photo source, so you won't have to change that much code. Your Photo viewer should extend TTThumbsViewController and implement the TTThumbsViewControllerDelegate delegate functions.

You can load the photo source in your viewDidLoad function:

///////////////////////////////////////////////////////////////////////////////////////////////////
- (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];

}
Howlend answered 21/9, 2011 at 18:14 Comment(1)
thank you I will test that first thing in the morning and let you know.Dodwell

© 2022 - 2024 — McMap. All rights reserved.