Change thumbs size in TTThumbsViewController

回眸只為那壹抹淺笑 提交于 2019-12-24 06:37:31

问题


Does anybody know if there is a way to increase the size of the images on the grid in a TTThumbsViewController in the three20 framework?

Thanks


回答1:


If you're using the TTThumbsViewController, you'll have to edit that file.

Change the kThumbSize to the size you want, and kThumbnailRowHeight to that value+4 (for the padding).

Then, in tableView:cell:willAppearAtIndexPath:, set:

 thumbsCell.thumbSize = kThumbSize;

so the thumbs know what size to be.




回答2:


Another way is to create a category of TTThumbsDataSource Copy the code below into a file ThumbnailDataSource.m and create a similiar headerfile. Include the header file in your TTThumbsViewController subclass. Set kThumbSize to the size you want.

#import <Three20/Three20.h>

@implementation TTThumbsDataSource(ThumbnailDataSource)
- (void)        tableView: (UITableView*)tableView
                     cell: (UITableViewCell*)cell
    willAppearAtIndexPath: (NSIndexPath*)indexPath {
    if ([cell isKindOfClass:[TTThumbsTableViewCell class]]) {
        TTThumbsTableViewCell* thumbsCell = (TTThumbsTableViewCell*)cell;
        thumbsCell.delegate = _delegate;
        thumbsCell.columnCount = [self columnCount];
        thumbsCell.thumbSize = kThumbSize;
    }
}

@end


来源:https://stackoverflow.com/questions/1945859/change-thumbs-size-in-ttthumbsviewcontroller

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!