开发者

How can I use Three20 to create a dynamic TTThumbsViewController that feeds from a website directory?

I'm pretty new to the iPhone developing scene, and I am designing an app for a high school band program. Part of the app needs to be an image gallery that retrieves photos from a directory on the band's website and lists them in开发者_运维问答 the thumbnail view. I can't figure out how to create a thumsview that isn't directly linked to specific pictures.

I currently have this setup to work with a UIWebView that points to a PHP photo album designed to look like the iPhone Photo Album. This method works, but it is not ideal, and the navigation is obviously a bit less than what would be expected.

Is Three20 the right tool for this job? If not, what should I be using?

Thanks!


You have to set it up much like it's set up in PhotoTest1Controller. Here's a snippet of what's there...

- (void)viewDidLoad {
    self.photoSource = [[[MockPhotoSource alloc]
        initWithType:MockPhotoSourceNormal
               title:@"Flickr Photos"
              photos:[NSArray arrayWithObjects:[[[MockPhoto alloc]
                                   initWithURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d.jpg?v=0"
                                      smallURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d_t.jpg"
                                          size:CGSizeMake(320, 480)] autorelease],
                                               [[[MockPhoto alloc]
                                   initWithURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d.jpg?v=0"
                                      smallURL:@"http://farm4.static.flickr.com/3099/3164979221_6c0e583f7d_t.jpg"
                                          size:CGSizeMake(320, 480)] autorelease],
                                               nil],

             photos2:nil] autorelease];
}

(I might be missing some brackets, but you get the gist)

Once you get a list of photos from your directory, you create an NSArray that contains a list of (in this case) MockPhotos and replace the photos array with this created one.

As for whether this is the right library for it, I'd say yes... it's been awesome to work with in my apps.

Hope this helps!

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜