【问题标题】:Three20 TTThumbviewcontroller paging Load more link doesn't add more rowsThree20 TTThumbviewcontroller 分页加载更多链接不会添加更多行
【发布时间】:2012-12-19 09:40:10
【问题描述】:
几天以来我一直在努力完成这项工作。我获得了用于加载更多缩略图的加载更多链接,当我选择链接时,它会加载其他记录,并且数据源会相应更新。但是,它不会添加额外的行并使用下一页索引更新加载更多链接。但是,在现有行中添加了其他图像,但不会添加具有其他图像的新行。
在从数据源添加其他记录后,我必须在 photoindex 中更改某些内容吗?
我正在从 sqlite 加载数据并且我有大量的记录。我正在寻找其他图书馆只是因为我无法完成这项工作。 :(。我还是很想用这个库。
非常感谢您在识别问题方面的任何帮助。提前致谢
【问题讨论】:
标签:
ios
paging
three20
ttthumbsviewcontroller
【解决方案1】:
错误出现在返回 maxPhotoIndex 的 PhotoSource 方法中。
它必须与 currentPage 和每页的照片数量同步。
【解决方案2】:
您应该创建 TTPhotoSource 的子类。
这是我的实现,希望能帮到你。
@implementation CSCourseListPhotoSource
//return count+1 to display more button
- (NSInteger)numberOfPhotos
{
return [self items].count + 1;
}
- (NSInteger)maxPhotoIndex
{
return [self items].count -1;
}
- (id<TTPhoto>)photoAtIndex:(NSInteger)index
{
if (index < [self items].count) {
...
return photo;
} else {
return nil;
}
}
@end