// // BigUserImgAlertView.m // TreeHole // // Created by 郑创权 on 2022/11/17. // #import "BigUserImgAlertView.h" @interface BigUserImgAlertView() @property (nonatomic, strong)UIImageView* userImgV; @end @implementation BigUserImgAlertView -(instancetype)initWithFrame:(CGRect)frame{ self = [super initWithFrame:frame]; if (self) { self.backgroundColor = HEX_COLOR_A(0x000000, 0.6); [self addSubview:self.userImgV]; self.userImgV.transform = CGAffineTransformMakeScale(0.1, 0.1); [UIView animateWithDuration:0.4 animations:^{ self.userImgV.transform = CGAffineTransformMakeScale(1, 1); } completion:^(BOOL finished) { }]; } return self; } -(UIImageView *)userImgV{ if (!_userImgV) { _userImgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, (SCREEN_HEIGHT - SCREEN_WIDTH)/2.0 - FIX_SIZE(60), SCREEN_WIDTH, SCREEN_WIDTH)]; _userImgV.contentMode = UIViewContentModeScaleToFill; } return _userImgV; } -(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event{ [self removeFromSuperview]; } -(void)setUserImg:(UIImage *)userImg{ _userImg = userImg; _userImgV.image = _userImg; } @end