popochess/PPImageScrollingTableViewCell
关于
PPImageScrollingTableViewCell is a UITableViewCell subclass that can make images scrollable horizontally in TableView.
设计与媒体实测星标增长
- 24小时
- 0
- 7天
- 0
- 15天
- 0
- 1个月
- 正在收集历史
各周期内的星标净变化,周期相互重叠,并非每日新增。缺失的测量保持空白。星标代表关注度,不代表软件质量。
README.md
原文PPImageScrollingTableViewCell
PPImageScrollingTableViewCell is a UITableViewCell subclass that can make images scrollable
horizontally in TableView.
PPImageScrollingTableViewCell allows to customize the cell to match your needs and uses delegate callbacks to handle actions in your UITableViewController

Installing
Add all files under PPImageScrollingTableViewCell folder to your project. Import the class header and register the cell class in your UITableView.
Usage
Set sample data first. use @"category" and @"images" for key of Dictionary
@property (strong, nonatomic) NSArray *images;
self.images = @[
@{ @"category": @"Category A",
@"images":
@[
@{ @"name":@"sample_1", @"title":@"A-0"},
@{ @"name":@"sample_2", @"title":@"A-1"},
@{ @"name":@"sample_3", @"title":@"A-2"},
@{ @"name":@"sample_4", @"title":@"A-3"},
@{ @"name":@"sample_5", @"title":@"A-4"},
@{ @"name":@"sample_6", @"title":@"A-5"}
]
},
@{ @"category": @"Category B",
@"images":
@[
@{ @"name":@"sample_3", @"title":@"B-0"},
@{ @"name":@"sample_1", @"title":@"B-1"},
@{ @"name":@"sample_2", @"title":@"B-2"},
@{ @"name":@"sample_5", @"title":@"B-3"},
@{ @"name":@"sample_6", @"title":@"B-4"},
@{ @"name":@"sample_4", @"title":@"B-5"}
]
}
];
Add PPImageScrollingTableViewCellDelegate in your header file if you want to receive delegate callbacks on cell interactions
#import "PPImageScrollingTableViewCell.h"
-(void)viewDidLoad
{
[super viewDidLoad];
[self.tableView registerClass:[PPImageScrollingTableViewCell class] forCellReuseIdentifier:CellIdentifier];
}
Subclass PPImageScrollingTableViewCell in tableview delegate
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
NSDictionary *cellData = [self.images objectAtIndex:[indexPath section]];
PPImageScrollingTableViewCell *customCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];
[customCell setDelegate:self];
[customCell setImageData:cellData];
[customCell setCategoryLabelText:[cellData objectForKey:@"category"] withColor:[UIColor whiteColor]];
[customCell setTag:[indexPath section]];
[customCell setImageTitleTextColor:[UIColor whiteColor] withBackgroundColor:[UIColor colorWithRed:0 green:0 blue:0 alpha:0.7]];
[customCell setImageTitleLabelWitdh:90 withHeight:45];
[customCell setCollectionViewBackgroundColor:[UIColor darkGrayColor]];
return customCell;
}
PPImageScrollingTableViewCell Delegate Methods
// Notifies the delegate when user click image
- (void)scrollingTableViewCell:(PPImageScrollingTableViewCell *)scrollingTableViewCell didSelectImageAtIndexPath:(NSIndexPath*)indexPathOfImage atCategoryRowIndex:(NSInteger)categoryRowIndex;
License
PPImageScrollingTableViewCell is released under the MIT license.
探索相关项目
加载中…