Commit af056d30 by GuoJianPeng

update

parent 5e13f85e
...@@ -29,8 +29,11 @@ ...@@ -29,8 +29,11 @@
[self _initBaseCellData]; [self _initBaseCellData];
_service = [[CRMNetDetectService alloc] initWithDelegate:self]; _service = [[CRMNetDetectService alloc] initWithDelegate:self];
_tableView = [[UITableView alloc] initWithFrame:frame]; _tableView = [[UITableView alloc] initWithFrame:frame];
_tableView.backgroundColor = UIColor.groupTableViewBackgroundColor;
_tableView.dataSource = self; _tableView.dataSource = self;
_tableView.rowHeight = 44; _tableView.rowHeight = 44;
_tableView.tableFooterView = [self _footView];
_tableView.tableHeaderView = [self _headView];
[self addSubview:_tableView]; [self addSubview:_tableView];
}return self; }return self;
} }
...@@ -61,6 +64,7 @@ ...@@ -61,6 +64,7 @@
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
CRMNetDetectCell * cell = [[CRMNetDetectCell alloc] initWithFrame:CGRectZero]; CRMNetDetectCell * cell = [[CRMNetDetectCell alloc] initWithFrame:CGRectZero];
cell.backgroundColor = UIColor.whiteColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
[cell updateData:_cellDatas[indexPath.row]]; [cell updateData:_cellDatas[indexPath.row]];
return cell; return cell;
...@@ -111,7 +115,7 @@ ...@@ -111,7 +115,7 @@
-(UIButton *)checkButton -(UIButton *)checkButton
{ {
if(!_checkButton){ if(!_checkButton){
_checkButton = [[UIButton alloc] initWithFrame:CGRectMake(20, 40, self.bounds.size.width-40, 40)]; _checkButton = [[UIButton alloc] init];
_checkButton.layer.cornerRadius = 3; _checkButton.layer.cornerRadius = 3;
_checkButton.backgroundColor = UIColor.orangeColor; _checkButton.backgroundColor = UIColor.orangeColor;
[_checkButton setTitle:@"重新检测" forState:UIControlStateNormal]; [_checkButton setTitle:@"重新检测" forState:UIControlStateNormal];
...@@ -120,4 +124,28 @@ ...@@ -120,4 +124,28 @@
[_checkButton addTarget:self action:@selector(startsChecking) forControlEvents:UIControlEventTouchUpInside]; [_checkButton addTarget:self action:@selector(startsChecking) forControlEvents:UIControlEventTouchUpInside];
}return _checkButton; }return _checkButton;
} }
- (UIView*)_footView
{
CGFloat marginTop = 50;
CGFloat marginBottom = 20;
CGFloat btnHeight = 40;
UIButton * btn = self.checkButton;
UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, marginTop+marginBottom+btnHeight)];
[view addSubview:btn];
btn.frame = CGRectMake(20, marginTop, view.bounds.size.width-40, btnHeight);
return view;
}
- (UIView*)_headView
{
CGFloat marginTop = 20;
CGFloat marginBottom = 30;
CGFloat btnHeight = 60;
CGFloat seperateHeight = 15;
UIView * view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.bounds.size.width, marginTop+marginBottom+btnHeight)];
view.backgroundColor = UIColor.whiteColor;
UIView * seperateView = [[UIView alloc] initWithFrame:CGRectMake(0, view.bounds.size.height-seperateHeight, view.bounds.size.width, seperateHeight)];
seperateView.backgroundColor = UIColor.groupTableViewBackgroundColor;
[view addSubview:seperateView];
return view;
}
@end @end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment