RAOrderEditViewController+TableDelegate.m 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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 = [UIColor lightGrayColor];
  18. UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(10, 11, CGRectGetWidth(tableView.bounds) - 20, 22)];
  19. [header addSubview:label];
  20. label.text = [self titleForSection:section];
  21. return header;
  22. }
  23. - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
  24. return 44.f;
  25. }
  26. @end