|
@@ -6,6 +6,9 @@
|
|
|
//
|
|
|
|
|
|
#import "BoxHeartbeatReStartView.h"
|
|
|
+@interface BoxHeartbeatReStartView ()
|
|
|
+@property (nonatomic,strong)UIImageView *topImage;
|
|
|
+@end
|
|
|
|
|
|
@implementation BoxHeartbeatReStartView
|
|
|
|
|
@@ -46,14 +49,14 @@
|
|
|
make.centerX.mas_equalTo(0.f);
|
|
|
}];
|
|
|
|
|
|
- UIImageView *topImage = [[UIImageView alloc] init];
|
|
|
- //topImage.image = [UIImage imageNamed:@"imageVersionFailTip"];
|
|
|
- topImage.backgroundColor = [UIColor lightGrayColor];
|
|
|
- [whiteBgView addSubview:topImage];
|
|
|
+ _topImage = [[UIImageView alloc] init];
|
|
|
+ _topImage.image = [UIImage imageNamed:@"restart_loading"];
|
|
|
+ //_topImage.backgroundColor = [UIColor lightGrayColor];
|
|
|
+ [whiteBgView addSubview:_topImage];
|
|
|
|
|
|
- [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
- make.height.mas_equalTo(104.f);
|
|
|
- make.width.mas_equalTo(123.f);
|
|
|
+ [_topImage mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.height.mas_equalTo(65.f);
|
|
|
+ make.width.mas_equalTo(63.f);
|
|
|
make.centerX.mas_equalTo(0.f);
|
|
|
make.top.mas_equalTo(30.f);
|
|
|
}];
|
|
@@ -71,7 +74,7 @@
|
|
|
//make.height.mas_equalTo(60);
|
|
|
make.right.mas_equalTo(-20.f);
|
|
|
make.left.mas_equalTo(20.f);
|
|
|
- make.top.equalTo(topImage.mas_bottom).offset(20);
|
|
|
+ make.top.equalTo(_topImage.mas_bottom).offset(20);
|
|
|
}];
|
|
|
|
|
|
NSString *tip1Str = NSLocalizedString(@"Heartbeat_box_restarting_phone_tip",nil);
|
|
@@ -91,7 +94,7 @@
|
|
|
//make.height.mas_equalTo(60);
|
|
|
make.right.mas_equalTo(-20.f);
|
|
|
make.left.mas_equalTo(20.f);
|
|
|
- make.top.equalTo(titleLab.mas_bottom).offset(10);
|
|
|
+ make.top.equalTo(titleLab.mas_bottom).offset(20);
|
|
|
}];
|
|
|
|
|
|
|
|
@@ -131,12 +134,25 @@
|
|
|
}];
|
|
|
|
|
|
|
|
|
-
|
|
|
+ [self startContinuousRotation];
|
|
|
}
|
|
|
|
|
|
|
|
|
- (void)colseFun
|
|
|
{
|
|
|
+ [self stopContinuousRotation];
|
|
|
[self removeFromSuperview];
|
|
|
}
|
|
|
+
|
|
|
+- (void)startContinuousRotation {
|
|
|
+ CABasicAnimation *rotationAnimation = [CABasicAnimation animationWithKeyPath:@"transform.rotation.z"];
|
|
|
+ rotationAnimation.toValue = [NSNumber numberWithFloat:M_PI * 2.0]; // 旋转360度
|
|
|
+ rotationAnimation.duration = 2.0; // 旋转一圈的时间
|
|
|
+ rotationAnimation.repeatCount = HUGE_VALF; // 无限重复
|
|
|
+ [_topImage.layer addAnimation:rotationAnimation forKey:@"rotationAnimation"];
|
|
|
+}
|
|
|
+
|
|
|
+- (void)stopContinuousRotation {
|
|
|
+ [_topImage.layer removeAnimationForKey:@"rotationAnimation"];
|
|
|
+}
|
|
|
@end
|