2009-12-22 69 views

回答

3

如果您使用的TTThumbsViewController,你必須編輯這個文件。

kThumbSize更改爲所需的大小,並將kThumbnailRowHeight更改爲該值+4(用於填充)。

然後,在tableView:cell:willAppearAtIndexPath:,設爲:

thumbsCell.thumbSize = kThumbSize; 

使拇指知道是什麼尺寸。

+0

謝謝!工作很好 – john 2009-12-22 21:14:57

1

另一種方法是創建一個類別TTThumbsDataSource 將以下代碼複製到文件ThumbnailDataSource.m中並創建一個類似的頭文件。 將頭文件包含在您的TTThumbsViewController子類中。將kThumbSize設置爲所需的大小。

#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