123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- //
- // imageVersionUpdateDoneView.m
- // 双子星云手机
- //
- // Created by xd h on 2024/12/27.
- //
- #import "imageVersionUpdateDoneView.h"
- @implementation imageVersionUpdateDoneView
- - (id)initWithFrame:(CGRect)frame{
- self = [super initWithFrame:frame];
- self.backgroundColor = [UIColor hwColor:@"000000" alpha:0.6];
- [self drawAnyView];
-
- return self;
- }
- - (void)drawAnyView{
- UIView*whiteBgView = [UIView new];
- whiteBgView.layer.cornerRadius = 8;
- whiteBgView.backgroundColor = [UIColor whiteColor];
- [self addSubview:whiteBgView];
-
- [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.height.mas_equalTo(289.f);
- make.width.mas_equalTo(300.f);
- make.centerY.mas_equalTo(-40.f);
- make.centerX.mas_equalTo(0.f);
- }];
-
- UIImageView *topImage = [[UIImageView alloc] init];
- topImage.image = [UIImage imageNamed:@"imageVersionDoneTip"];
- [whiteBgView addSubview:topImage];
-
- [topImage mas_makeConstraints:^(MASConstraintMaker *make) {
- make.height.mas_equalTo(104.f);
- make.width.mas_equalTo(123.f);
- make.centerX.mas_equalTo(0.f);
- make.top.mas_equalTo(30.f);
- }];
-
- NSString *curTitleStr = NSLocalizedString(@"image_version_update_suc_title",nil);
- UILabel *titleLab = [[UILabel alloc] init];
- titleLab.text = curTitleStr;
- titleLab.numberOfLines = 0;
- titleLab.textColor = [UIColor blackColor];
- titleLab.font = [UIFont boldSystemFontOfSize:18.0];
- titleLab.textAlignment = NSTextAlignmentCenter;
- [whiteBgView addSubview:titleLab];
-
- [titleLab mas_makeConstraints:^(MASConstraintMaker *make) {
- //make.height.mas_equalTo(60);
- make.right.mas_equalTo(0.f);
- make.left.mas_equalTo(0.f);
- make.top.equalTo(topImage.mas_bottom).offset(20);
- }];
-
-
-
- UIButton *knowBut = [[UIButton alloc] init];
- [knowBut setTitle:NSLocalizedString(@"common_I_know",nil) forState:UIControlStateNormal];
- //knowBut.layer.cornerRadius = 8;
- //knowBut.layer.masksToBounds = YES;
- [knowBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
- [knowBut addTarget:self action:@selector(colseFun) forControlEvents:UIControlEventTouchUpInside];
- [whiteBgView addSubview:knowBut];
-
- CAGradientLayer *gradientLayer = [CAGradientLayer layer];
- gradientLayer.frame = CGRectMake(0, 0, 268, 40);
- gradientLayer.colors = @[(__bridge NSString *)[UIColor hwColor:@"#0CDEFD" alpha:1.0].CGColor, (__bridge NSString *)[UIColor hwColor:@"#058DFB" alpha:1.0].CGColor];
- gradientLayer.locations = @[@(0), @(1.0f)];
- gradientLayer.startPoint = CGPointMake(0, 0.5);
- gradientLayer.endPoint = CGPointMake(0.97, 0.5);
- gradientLayer.cornerRadius = 8;
- [knowBut.layer addSublayer:gradientLayer];
- // knowBut.layer.shadowColor = [UIColor hwColor:@"#058DFB"].CGColor;
- // // 设置阴影透明度(0.0到1.0)
- // knowBut.layer.shadowOpacity = 0.5;
- // // 设置阴影偏移量(x, y)
- // knowBut.layer.shadowOffset = CGSizeMake(0, 3);
- // // 设置阴影模糊半径
- // knowBut.layer.shadowRadius = 5.0;
- // // 为了使阴影在按钮外部可见,需要设置masksToBounds为NO
- // // 注意:如果父视图设置了masksToBounds为YES,那么阴影可能仍然不可见
- // knowBut.layer.masksToBounds = NO;
-
- [knowBut mas_makeConstraints:^(MASConstraintMaker *make) {
- make.height.mas_equalTo(40.f);
- make.width.mas_equalTo(268.f);
- make.centerX.mas_equalTo(0.f);
- make.bottom.mas_equalTo(-30);
- }];
-
-
- }
- - (void)colseFun
- {
- [self removeFromSuperview];
- if(_didClickUpdateDoneFun){
- _didClickUpdateDoneFun();
- }
- }
- @end
|