RAOrderEditViewController+TableDelegate.m 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. //
  2. // RAOrderEditViewController+TableDelegate.m
  3. // Apex And Drivers
  4. //
  5. // Created by Jack on 2018/6/4.
  6. // Copyright © 2018年 USAI. All rights reserved.
  7. //
  8. #import "RAOrderEditViewController+TableDelegate.h"
  9. #import "RAEditBaseModel.h"
  10. @implementation RAOrderEditViewController (TableDelegate)
  11. - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
  12. RAEditBaseModel *model = [self modelForIndexPath:indexPath];
  13. return model.height;
  14. }
  15. - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
  16. UIView *header = [[UIView alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 44.0f)];
  17. header.backgroundColor = ApexDriverGrayColor;
  18. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 20, 22)];
  19. label.textColor = ApexDriverWhiteColor;
  20. [header addSubview:label];
  21. label.text = [self titleForSection:section];
  22. return header;
  23. }
  24. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  25. return 44.f;
  26. }
  27. @end