|
@@ -176,22 +176,34 @@ static HaveNewVersionView * _instance;
|
|
|
// make.bottom.mas_equalTo(-92);
|
|
|
// }];
|
|
|
|
|
|
-// /*确定按钮*/
|
|
|
-// UIButton *okBtn = [[UIButton alloc] init];
|
|
|
-// [okBtn setBackgroundImage:[UIImage imageNamed:@"login_select_corner"] forState:(UIControlStateNormal)];
|
|
|
-// [okBtn setTitle:@"更新" forState:(UIControlStateNormal)];
|
|
|
-// [okBtn.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
|
|
|
-// [okBtn addTarget:self action:@selector(updateBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
-// [okBtn.layer setCornerRadius:20.f];
|
|
|
-// okBtn.layer.masksToBounds = YES;
|
|
|
-// [bgView addSubview:okBtn];
|
|
|
-//
|
|
|
-// [okBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
-// make.height.mas_equalTo(40.f);
|
|
|
-// make.width.mas_equalTo(168.f);
|
|
|
-// make.centerX.equalTo(bgView.mas_centerX);
|
|
|
-// make.bottom.mas_equalTo(-20.f);
|
|
|
-// }];
|
|
|
+ // gradient
|
|
|
+ CAGradientLayer *gl = [CAGradientLayer layer];
|
|
|
+ gl.frame = CGRectMake(0,0,160.f,40.f);
|
|
|
+ gl.startPoint = CGPointMake(0, 0.5);
|
|
|
+ gl.endPoint = CGPointMake(1, 0.5);
|
|
|
+ gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
|
|
|
+ gl.locations = @[@(0), @(1.0f)];
|
|
|
+
|
|
|
+ if(_versionModel.necessary){
|
|
|
+ UIButton *updatekBtn = [[UIButton alloc] init];
|
|
|
+ updatekBtn.frame = CGRectMake(0, 0, 160.f, 40.f);
|
|
|
+
|
|
|
+ [updatekBtn.layer addSublayer:gl];
|
|
|
+ [updatekBtn addTarget:self action:@selector(updateBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
+ [updatekBtn setTitle:NSLocalizedString(@"app_update_update",nil) forState:(UIControlStateNormal)];
|
|
|
+ [updatekBtn setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
|
|
|
+ [updatekBtn.titleLabel setFont:[UIFont systemFontOfSize:16.f]];
|
|
|
+ [updatekBtn.layer setCornerRadius:8.f];
|
|
|
+ updatekBtn.clipsToBounds = YES;
|
|
|
+ [bgView addSubview:updatekBtn];
|
|
|
+ [updatekBtn mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
+ make.centerX.equalTo(bgView.mas_centerX);
|
|
|
+ make.width.mas_equalTo(160.f);
|
|
|
+ make.bottom.mas_equalTo(-30.f);
|
|
|
+ make.height.mas_equalTo(40.f);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+ else{
|
|
|
|
|
|
/*稍后再说 按钮 app_update_wait*/
|
|
|
UIButton *waitBtn = [[UIButton alloc] init];
|
|
@@ -209,16 +221,8 @@ static HaveNewVersionView * _instance;
|
|
|
}];
|
|
|
|
|
|
UIButton *updatekBtn = [[UIButton alloc] init];
|
|
|
- updatekBtn.frame = CGRectMake(0, 0, 160.f, 48.f);
|
|
|
+ updatekBtn.frame = CGRectMake(0, 0, 160.f, 40.f);
|
|
|
|
|
|
- // gradient
|
|
|
- CAGradientLayer *gl = [CAGradientLayer layer];
|
|
|
- gl.frame = CGRectMake(0,0,160.f,48.f);
|
|
|
- gl.startPoint = CGPointMake(0, 0.5);
|
|
|
- gl.endPoint = CGPointMake(1, 0.5);
|
|
|
- gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
|
|
|
- gl.locations = @[@(0), @(1.0f)];
|
|
|
-
|
|
|
[updatekBtn.layer addSublayer:gl];
|
|
|
[updatekBtn addTarget:self action:@selector(updateBtnPressed) forControlEvents:(UIControlEventTouchUpInside)];
|
|
|
[updatekBtn setTitle:NSLocalizedString(@"app_update_update",nil) forState:(UIControlStateNormal)];
|
|
@@ -234,7 +238,7 @@ static HaveNewVersionView * _instance;
|
|
|
make.height.mas_equalTo(40.f);
|
|
|
}];
|
|
|
|
|
|
-
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- (void)waitBtnPressed
|