当我使用Three20的TTThumbViewController时,如何在缩略图视图底部添加加载更多按钮?
问题描述:
我使用了Three20并使用TTThumbViewController创建了缩略图照片视图。我已经成功在缩略图视图中显示图像。现在我想从服务器添加更多图像,因此我需要在视图底部添加“加载更多”按钮,或者当页面滚动到底部时,它会自动加载更多图像。 非常感谢!当我使用Three20的TTThumbViewController时,如何在缩略图视图底部添加加载更多按钮?
答
试试这个在您的光源类
- (void)load:(TTURLRequestCachePolicy)cachePolicy more:(BOOL)more {
if (more) {
page++;
}
//http://www.theblacksheeponline.com/partypics.php?page=2
NSString *Page = [NSString stringWithFormat:@"%lu", (unsigned long)page];
NSString *url = [@"http:/.......pics.php?page=" stringByAppendingString:Page];
NSLog(@"ALPhotoSource url: %@", url);
TTURLRequest* request = [TTURLRequest requestWithURL:url delegate:self];
request.cachePolicy = cachePolicy;
// sets the response
request.response = responseProcessor;
request.httpMethod = @"GET";
// Dispatch the request.
[request send];
}
希望这有助于!