forked from yishuiliunian/DZTableView
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDZTableViewController.m
More file actions
executable file
·89 lines (76 loc) · 2.34 KB
/
DZTableViewController.m
File metadata and controls
executable file
·89 lines (76 loc) · 2.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
//
// DZTableViewController.m
// TimeUI
//
// Created by Stone Dong on 13-12-12.
// Copyright (c) 2013年 Stone Dong. All rights reserved.
//
#import "DZTableViewController.h"
#import "DZGeometryTools.h"
#import "DZInputCellView.h"
@interface DZTableViewController () <DZPullDownDelegate, UIScrollViewDelegate, DZInputCellViewDelegate>
{
}
@end
@implementation DZTableViewController
@synthesize tableView = _tableView;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}
- (DZTableView*) tableView
{
if (!_tableView) {
_tableView = [[DZTableView alloc] initWithFrame:CGRectLoadViewFrame];
_tableView.dataSource = self;
_tableView.delegate = self;
_tableView.actionDelegate = self;
}
return _tableView;
}
- (void) loadView
{
[super loadView];
DZTableView* tableView = self.tableView;
DZPullDownView* pullView = [[DZPullDownView alloc] init];
pullView.height = 44;
pullView.delegate = self;
tableView.topPullDownView = pullView;
}
- (void)viewDidLoad
{
[super viewDidLoad];
_backgroudView = [UIImageView new];
_backgroudView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:_backgroudView];
_headerView = [[UIImageView alloc] init];
[self.view addSubview:_headerView];
[self.view addSubview:self.tableView];
_headerView.backgroundColor = [UIColor darkGrayColor];
_headerView.alpha = 0.8;
_headerView.layer.cornerRadius = 10;
// Do any additional setup after loading the view.
}
- (void) viewWillLayoutSubviews
{
[super viewWillLayoutSubviews];
_backgroudView.frame = self.view.bounds;
[self.view insertSubview:_backgroudView atIndex:0];
_headerView.frame = CGRectMake(5, 20, CGRectGetWidth(self.view.frame)-10, 20);
_tableView.frame = CGRectMake(10, CGRectGetMaxY(_headerView.frame)-10, CGRectGetWidth(self.view.frame)-20, CGRectGetHeight(self.view.frame) - CGRectGetMaxY(_headerView.frame));
[_tableView reloadData];
}
- (void) viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end