-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSecondViewController.m
More file actions
201 lines (159 loc) · 6.17 KB
/
Copy pathSecondViewController.m
File metadata and controls
201 lines (159 loc) · 6.17 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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
//
// SecondViewController.m
// JCFrameLayout
//
// Created by abc on 17/3/27.
// Copyright © 2017年 jackcat. All rights reserved.
//
#import "SecondViewController.h"
#import "JCFrameLayout.h"
@interface SecondViewController ()
/**
* <#注释#>
**/
@property (nonatomic,strong) UIView *redView;
/**
* <#注释#>
**/
@property (nonatomic,strong) UIView *greenView;
@end
@implementation SecondViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.redView = [[UIView alloc]init];
self.redView.backgroundColor = [UIColor redColor];
[self.view addSubview:self.redView];
self.greenView = [[UIView alloc]init];
self.greenView.backgroundColor = [UIColor greenColor];
[self.view addSubview:self.greenView];
[self.redView jc_makeLayout:^(JCFrameMake *make) {
// 25. left and right and top and bottom
// make.left.jc_equalTo(50);
// make.right.jc_equalTo(-50);
// make.top.jc_equalTo(50);
// make.bottom.jc_equalTo(-50);
make.left.top.width.height.jc_equalTo(100);
// 24. right and top and bottom and width
// make.right.jc_equalTo(-50);
// make.top.jc_equalTo(50);
// make.bottom.jc_equalTo(-50);
// make.width.jc_equalTo(100);
// 23. left and top and bottom and width
// make.left.jc_equalTo(50);
// make.top.jc_equalTo(50);
// make.bottom.jc_equalTo(-50);
// make.width.jc_equalTo(100);
// 22. left and right and bottom and height
// make.left.jc_equalTo(50);
// make.right.jc_equalTo(-50);
// make.bottom.jc_equalTo(-50);
// make.height.jc_equalTo(100);
// 21. left and right and top and height
// make.left.jc_equalTo(50);
// make.right.jc_equalTo(-50);
// make.top.jc_equalTo(50);
// make.height.jc_equalTo(100);
// 20. right and bottom and width and height
// make.right.jc_equalTo(-50);
// make.bottom.jc_equalTo(-50);
// make.height.jc_equalTo(100);
// make.width.jc_equalTo(100);
// 19. right and top and width and height
// make.right.jc_equalTo(-50);
// make.top.jc_equalTo(50);
// make.height.jc_equalTo(100);
// make.width.jc_equalTo(100);
// 18. left and bottom and width and height
// make.left.jc_equalTo(50);
// make.bottom.jc_equalTo(-50);
// make.height.jc_equalTo(100);
// make.width.jc_equalTo(100);
//
// 17. left and top and width and height
// make.left.jc_equalTo(50);
// make.top.jc_equalTo(50);
// make.height.jc_equalTo(100);
// make.width.jc_equalTo(100);
// 16. centerY and right and width and height
// make.centerY.jc_equalTo(100);
// make.right.jc_equalTo(-100);
// make.width.jc_equalTo(100);
// make.height.jc_equalTo(100);
// 15. centerY and left and width and height
// make.centerY.jc_equalTo(100);
// make.left.jc_equalTo(100);
// make.width.jc_equalTo(100);
// make.height.jc_equalTo(100);
// 14. centerX and bottom and width and height
// make.centerX.jc_equalTo(100);
// make.bottom.jc_equalTo(-50);
// make.width.jc_equalTo(100);
// make.height.jc_equalTo(100);
// 13. centerX and top and width and height
// make.centerX.jc_equalTo(100);
// make.top.jc_equalTo(100);
// make.width.jc_equalTo(100);
// make.height.jc_equalTo(100);
// 12. centerX and centerY and width and height
// make.centerX.jc_equalTo(100);
// make.centerY.jc_equalTo(100);
// make.width.jc_equalTo(100);
// make.height.jc_equalTo(100);
// 11. right and bottom and size
// make.right.jc_equalTo(-50);
// make.bottom.jc_equalTo(-50);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 10. right and top and size
// make.right.jc_equalTo(-50);
// make.top.jc_equalTo(100);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 9. left and bottom and size
// make.left.jc_equalTo(100);
// make.bottom.jc_equalTo(50);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 8. left and top and size
// make.left.jc_equalTo(100);
// make.top.jc_equalTo(100);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 7. centerY and right and size
// make.centerY.jc_equalTo(100);
// make.right.jc_equalTo(-50);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 6. centerY and left and size
// make.centerY.jc_equalTo(200);
// make.left.jc_equalTo(100);
// make.size.jc_equalTo(CGSizeMake(200, 200));
// 5. centerX and bottom and size
// make.centerX.jc_equalTo(100);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// make.bottom.jc_equalTo(-50);
// 4. centerX and top and size
// make.centerX.jc_equalTo(100);
// make.top.jc_equalTo(50);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 3.centerX and centerY and size
// make.centerX.jc_equalTo(100);
// make.centerY.jc_equalTo(100);
// make.size.jc_equalTo(CGSizeMake(100, 100));
// 2. center and width and height
// make.center.jc_equalTo(CGPointMake(100, 100));
// make.width.jc_equalTo(200);
// make.height.jc_equalTo(200);
// 1. center and size
// make.center.jc_equalTo(CGPointMake(100, 100));
// make.size.jc_equalTo(CGSizeMake(100, 100));
}];
// [self.greenView jc_makeLayout:^(JCFrameMake *make) {
// make.left.jc_equalTo(50);
// make.width.jc_equalTo(100);
//
// make.top.jc_equalTo(50);
// make.height.jc_equalTo(100);
// }];
NSLog(@"self.redView.frame = %@",[NSValue valueWithCGRect:self.redView.frame]);
}
-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event{
[self dismissViewControllerAnimated:YES completion:nil];
}
@end