@@ -42,7 +42,7 @@ - (void)viewDidLoad {
42
42
*/
43
43
- (void )panGestureRecognizer : (UIPanGestureRecognizer *)panGestureRecognizer {
44
44
// 获取拖拽手势在self.view 的拖拽姿态
45
- CGPoint translation = [panGestureRecognizer translationInView: self .view.window ];
45
+ CGPoint translation = [panGestureRecognizer translationInView: self .view];
46
46
switch (panGestureRecognizer.state ) {
47
47
case UIGestureRecognizerStateBegan:{
48
48
// 记录起始点位置
@@ -60,7 +60,7 @@ - (void)panGestureRecognizer:(UIPanGestureRecognizer *)panGestureRecognizer{
60
60
// 改变panGestureRecognizer.view的中心点 就是self.imageView的中心点
61
61
panGestureRecognizer.view .center = CGPointMake (panGestureRecognizer.view .center .x + translation.x , panGestureRecognizer.view .center .y + translation.y );
62
62
// 重置拖拽手势的姿态
63
- [panGestureRecognizer setTranslation: CGPointZero inView: self .view.window ];
63
+ [panGestureRecognizer setTranslation: CGPointZero inView: self .view];
64
64
65
65
[self .ghostList enumerateObjectsUsingBlock: ^(UIImageView * obj, NSUInteger idx, BOOL * _Nonnull stop) {
66
66
[UIView animateWithDuration: 0.1 delay: 0.1 * idx options: UIViewAnimationOptionCurveEaseInOut animations: ^{
@@ -87,8 +87,8 @@ -(void)addItem{
87
87
img.layer .cornerRadius = _tx.layer .cornerRadius ;
88
88
img.layer .masksToBounds = YES ;
89
89
img.alpha = 1 - (i * 0.15 );
90
- img.transform = CGAffineTransformMakeScale (1 - 0.1 * i,1 - 0.1 * i);
91
- [self .view.window addSubview: img];
90
+ img.transform = CGAffineTransformMakeScale (1 - 0.05 * i,1 - 0.05 * i);
91
+ [self .view addSubview: img];
92
92
[self .ghostList addObject: img];
93
93
}
94
94
}
0 commit comments