tableView
来源:互联网 发布:eplan软件界面 编辑:程序博客网 时间:2024/05/17 23:58
// 索引的集合- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView{ return _sectionIndexArray;}// 索引滚动的 section- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index{ return [kSectionIndexs rangeOfString:title].location;}// section count- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{ return [_sectionIndexArray count];}// section//- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section//{// if (section == 0) {// return @"分组";// }// else {// return [_sectionIndexArray objectAtIndex:section];// }//}- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ if (section == 0) return [_groupDataArray count] ? tableView.sectionHeaderHeight : 0; else return [[_personDataArray objectAtIndex:section] count] ? tableView.sectionHeaderHeight : 0;}- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ SCSectionHeaderView *sectionHeaderView = [[SCSectionHeaderView alloc] init]; if (section == 0) { sectionHeaderView.contentLabel.text = @"分组"; } else { sectionHeaderView.contentLabel.text = [[_personDataArray objectAtIndex:section] count] ? [[kSectionIndexs substringFromIndex:section] substringToIndex:1] : nil; } return [sectionHeaderView autorelease];}- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{ if (section == 0) { return [_groupDataArray count]; } else { return [[_personDataArray objectAtIndex:section] count]; }}- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ return 60;}- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{ if (indexPath.section == 0) { static NSString *cellID = @"SCGroupTable"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (!cell) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID] autorelease]; } if (_groupDataArray.count > 0) { cell.textLabel.text = [(SCGroupTable *)[_groupDataArray objectAtIndex:indexPath.row] groupName]; } return cell; } else { static NSString *cellID = @"SCCustomerTable"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID]; if (!cell) { cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID] autorelease]; } if ([(NSArray *)[_personDataArray objectAtIndex:indexPath.section] count]) { cell.textLabel.text = [(SCCustomerTable *)[[_personDataArray objectAtIndex:indexPath.section] objectAtIndex:indexPath.row] customerName]; NSLog(@"...."); } return cell; }}- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ NSLog(@"");}
0 0
- TableView
- TableView
- tableview
- tableview
- tableview
- TableView
- TABLEVIEW
- tableView
- tableView
- TableView
- tableview
- tableview
- tableView
- tableView
- tableView
- tableView
- TableView
- tableview
- multipath多路径配置问题汇总
- 6410 uboot和内核的移植
- Linux 网桥代码分析 六 网桥数据转发函数分析
- strlen和sizeof的区别
- 因子和阶乘
- tableView
- FZU 2035
- poj 2785--4 Values whose Sum is 0(折半枚举)
- 企业级Hadoop能够解决的问题
- 一起学Maven(Maven仓库管理器之应用Nexus)<六>
- poj 2488:A Knight's Journey
- linux 列出两个文件的差异行
- linux内核cdev_init系列函数(字符设备的注册)
- 多线程精华,面试专用