| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126 |
- //
- // manufactureDetailListViewController.m
- // IBOSS
- //
- // Created by 关宏厚 on 2018/11/15.
- // Copyright © 2018 elongtian. All rights reserved.
- //
- #import "ManufactureDetailListViewController.h"
- @interface ManufactureDetailListViewController ()
- @end
- @implementation ManufactureDetailListViewController
- #pragma mark - 公共函数
- /**
- 视图加载完成函数
- */
- - (void)viewDidLoad {
- [super viewDidLoad];
- [self initUI];
- }
- #pragma mark - 委托函数
- /**
- 指定每一组有几行
- @param tableView tableView
- @param section 第几组
- @return 几行
- */
- - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{
- return 1;
- }
- /**
- 指定每个cell的高度
- @param tableView tableView
- @param indexPath 组数,行数的封装
- @return 每个cell的高度
- */
- - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
- return 928;
- }
- /**
- 有几组
- @param tableView tableView
- @return 组数
- */
- - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
- return _manuDetailArray.count;
- }
- - (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
- {
- UIView *view = [[UIView alloc] init];
- view.backgroundColor = [UIColor clearColor];
- return view ;
- }
- /**
- tableview分区的间隔高度
- @param tableView <#tableView description#>
- @param section <#section description#>
- @return <#return value description#>
- */
- - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
- {
- return 10;
- }
- /**
- 返回每个cell
- @param tableView tableView
- @param indexPath 组数,行数的封装
- @return 返回cell
- */
- - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
- static NSString *cellIdentifier = @"ManuDetailCell";
- ManufactureDetailListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
- if (!cell) {
- cell = [[ManufactureDetailListCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
- }
- else
- //当页面拉动的时候 当cell存在并且最后一个存在 把它进行删除就出来一个独特的cell我们在进行数据配置即可避免
- {
- while ([cell.contentView.subviews lastObject] != nil) {
- [(UIView *)[cell.contentView.subviews lastObject] removeFromSuperview];
- }
- }
- ManufactureDetailModel *detailModel= _manuDetailArray[indexPath.section];
- [cell setManufactureDetailCell:detailModel];
-
- return cell;
- }
- #pragma mark - 私有函数
- -(void)initUI
- {
-
- _vTableView = [[UITableView alloc]
- initWithFrame:CGRectMake(10, 10, self.view.frame.size.width-20,
- self.view.frame.size.height-100-rectStatusHeight-rectNavHeight)];
- _vTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
- _vTableView.autoresizingMask = UIViewAutoresizingFlexibleHeight;
- _vTableView.delegate = self;
- _vTableView.dataSource=self;
- _vTableView.backgroundColor = [UIColor clearColor];
- [self.view addSubview:_vTableView];
-
- }
- -(void)loadData:(NSMutableArray*)detailArray{
- _manuDetailArray=detailArray;
- [_vTableView reloadData];
- }
- @end
|