FenceSiteVC.m 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. //
  2. // FenceSiteVC.m
  3. // jiaPei
  4. //
  5. // Created by apple on 2017/8/16.
  6. // Copyright © 2017年 JCZ. All rights reserved.
  7. //
  8. #import "FenceSiteVC.h"
  9. #import "FenceSiteCell.h"
  10. #import "AllCoachPlanVC.h"
  11. @interface FenceSiteVC ()<UITableViewDelegate,UITableViewDataSource>
  12. {
  13. UITableView *mainTableView;
  14. }
  15. @end
  16. @implementation FenceSiteVC
  17. - (void)viewDidLoad {
  18. [super viewDidLoad];
  19. self.title = @"选择训练场";
  20. self.view.backgroundColor = [UIColor lightGrayColor];
  21. [self goBackByNavigation];
  22. mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStyleGrouped];
  23. mainTableView.height -= kNavOffSet;
  24. mainTableView.delegate = self;
  25. mainTableView.dataSource = self;
  26. mainTableView.rowHeight = 380;
  27. mainTableView.estimatedSectionFooterHeight = 0;
  28. mainTableView.estimatedSectionHeaderHeight = 0;
  29. mainTableView.backgroundColor = [UIColor colorWithWhite:0.85 alpha:1.0];
  30. [self.view addSubview:mainTableView];
  31. }
  32. -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
  33. return _dataArray.count;
  34. }
  35. -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
  36. {
  37. return 1;
  38. }
  39. -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
  40. {
  41. FenceSiteCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FenceSiteCell"];
  42. if (cell == nil)
  43. {
  44. cell = [[FenceSiteCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"FenceSiteCell"];
  45. cell.selectionStyle = UITableViewCellSelectionStyleNone;
  46. cell.superVC = self;
  47. }
  48. cell.dataDic = _dataArray[indexPath.section];
  49. return cell;
  50. }
  51. -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
  52. {
  53. AllCoachPlanVC *vc = [[AllCoachPlanVC alloc] init];
  54. NSDictionary *dic = _dataArray[indexPath.row];
  55. vc.fenceSiteID = [NSString stringWithFormat:@"%@",dic[@"ID"]];
  56. [self navPushHideTabbarToVC:vc];
  57. }
  58. -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
  59. return 15;
  60. }
  61. -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
  62. return 0.1;
  63. }
  64. - (void)didReceiveMemoryWarning {
  65. [super didReceiveMemoryWarning];
  66. }
  67. @end