
-(void)tableView:(UITableView *)tableView willDisplayHeaderView:(UIView *)view forSection:(NSInteger)section
{
UITableViewHeaderFooterView *header = (UITableViewHeaderFooterView *)view
header.textLabel.textColor = [UIColor redColor]
header.contentView.backgroundColor = [UIColor yellowColor]
}
//右侧索引的设置
#pragma mark = 索引的设置
//索引标题
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section{
return self.indexArr[section]
}
//系统的右侧索引数组
- (NSArray*)sectionIndexTitlesForTableView:(UITableView *)tableView
{
return self.indexArr
}
//索引列点击事件
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
[self.view endEditing:YES]
NSString *string = self.indexArr[index]
[self showCenterIndexShowView:string]
return index
}
(UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{ UIView *v_headerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 320, 23)]//创建一个视图(v_headerView) UIImageView *v_headerImage.欢迎分享,转载请注明来源:内存溢出
微信扫一扫
支付宝扫一扫
评论列表(0条)