iOS源碼下載:按組堆疊的單元格
作者:佚名
第三方庫(kù)TFStackingSectionsTableView可以把單元格按組堆疊。組頭顯示在表格上,點(diǎn)擊組頭可以展開對(duì)應(yīng)的單元格。
支持平臺(tái):iOS
運(yùn)行環(huán)境:iOS
開發(fā)語(yǔ)言:Object-c
開發(fā)工具:Xcode
源碼大?。?0.27KB
源碼下載地址:http://down.51cto.com/data/1975620
源碼簡(jiǎn)介
第三方庫(kù)TFStackingSectionsTableView可以把單元格按組堆疊。組頭顯示在表格上,點(diǎn)擊組頭可以展開對(duì)應(yīng)的單元格。
源碼運(yùn)行截圖
效果圖
源碼片段
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- self.groups = @[@"Group A", @"Group B", @"Group C", @"Group D", @"Group E", @"Group F", @"Group G", @"Group H"];
- self.members = @[
- @[@"Brazil", @"Mexico", @"Croatia", @"Cameroon"],
- @[@"Netherlands", @"Chile", @"Spain", @"Australia"],
- @[@"Columbia", @"Greece", @"Côte D'Ivoire", @"Japan"],
- @[@"Costa Rica", @"Uraguay", @"Italy", @"England"],
- @[@"France", @"Switzerland", @"Ecuador", @"Honduras"],
- @[@"Argentina", @"Nigeria", @"Bosnia and Herzegovina", @"Iran"],
- @[@"Germany", @"USA", @"Portugal", @"Ghana"],
- @[@"Belgium", @"Algeria", @"Russia", @"Korea Republic"]
- ];
- }
- - (UIView *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section {
- return self.groups[section];
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
- {
- return nil;
- UILabel *label = [UILabel new];
- label.text = [@" " stringByAppendingString:self.groups[section]];
- label.backgroundColor = [UIColor colorWithWhite:0.97f alpha:1.0];
- label.textColor = [UIColor colorWithWhite:0.13f alpha:1.0];
- label.font = [UIFont boldSystemFontOfSize:14.0f];
- return label;
- }
責(zé)任編輯:閆佳明
來(lái)源:
網(wǎng)絡(luò)整理