tableViewSectionHeader 字体及背景色设置

tableViewSectionHeader 字体及背景色设置,第1张

//区头的字体颜色设置

-(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.


欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/tougao/7879939.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2023-04-11
下一篇2023-04-11

发表评论

登录后才能评论

评论列表(0条)

    保存