// // FenceSiteVC.m // jiaPei // // Created by apple on 2017/8/16. // Copyright © 2017年 JCZ. All rights reserved. // #import "FenceSiteVC.h" #import "FenceSiteCell.h" #import "AllCoachPlanVC.h" @interface FenceSiteVC () { UITableView *mainTableView; } @end @implementation FenceSiteVC - (void)viewDidLoad { [super viewDidLoad]; self.title = @"选择训练场"; self.view.backgroundColor = [UIColor lightGrayColor]; [self goBackByNavigation]; mainTableView = [[UITableView alloc] initWithFrame:kFrame style:UITableViewStyleGrouped]; mainTableView.height -= kNavOffSet; mainTableView.delegate = self; mainTableView.dataSource = self; mainTableView.rowHeight = 380; mainTableView.estimatedSectionFooterHeight = 0; mainTableView.estimatedSectionHeaderHeight = 0; mainTableView.backgroundColor = [UIColor colorWithWhite:0.85 alpha:1.0]; [self.view addSubview:mainTableView]; } -(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return _dataArray.count; } -(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section { return 1; } -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { FenceSiteCell *cell = [tableView dequeueReusableCellWithIdentifier:@"FenceSiteCell"]; if (cell == nil) { cell = [[FenceSiteCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"FenceSiteCell"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.superVC = self; } cell.dataDic = _dataArray[indexPath.section]; return cell; } -(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { AllCoachPlanVC *vc = [[AllCoachPlanVC alloc] init]; NSDictionary *dic = _dataArray[indexPath.row]; vc.fenceSiteID = [NSString stringWithFormat:@"%@",dic[@"ID"]]; [self navPushHideTabbarToVC:vc]; } -(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{ return 15; } -(CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{ return 0.1; } - (void)didReceiveMemoryWarning { [super didReceiveMemoryWarning]; } @end