// // RAOrderEditViewController+TableDelegate.m // Apex And Drivers // // Created by Jack on 2018/6/4. // Copyright © 2018年 USAI. All rights reserved. // #import "RAOrderEditViewController+TableDelegate.h" #import "RAEditBaseModel.h" @implementation RAOrderEditViewController (TableDelegate) - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { RAEditBaseModel *model = [self modelForIndexPath:indexPath]; return model.height; } - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section { UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)]; header.backgroundColor = [UIColor lightGrayColor]; UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 20, 22)]; [header addSubview:label]; label.text = [self titleForSection:section]; return header; } - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { return 44.f; } @end