12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //
- // YOUPAIZYAdvertWindow.m
- // VQU
- //
- // Created by Elaine on 2020/10/14.
- // Copyright © 2020 leo. All rights reserved.
- //
- #import "YOUPAIZYAdvertWindow.h"
- @interface YOUPAIZYAdvertWindow ()
- @property(nonatomic,strong)UIImageView *youpaipimgV;
- @end
- @implementation YOUPAIZYAdvertWindow
- - (void)viewDidLoad {
- [super viewDidLoad];
- // [self.view setFrame:CGRectMake(0, 0, _vWith, _vHeight)];
- // CAShapeLayer *maskLayer = [CAShapeLayer layer];
- // UIBezierPath *path = [UIBezierPath bezierPathWithRoundedRect:self.view.bounds cornerRadius:25];
- // maskLayer.path = path.CGPath;
- // self.view.layer.mask = maskLayer;
- // [self.view setBackgroundColor:[UIColor whiteColor]];
-
- self.baseView.backgroundColor = [UIColor clearColor];
- _youpaipimgV = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, self.vWidth,self.vHeight)];
- _youpaipimgV.layer.cornerRadius = 25;
- _youpaipimgV.layer.masksToBounds = YES;
- [_youpaipimgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:_youpaipimageurl]];
- [self.baseView addSubview:self.youpaipimgV];
- _youpaipimgV.userInteractionEnabled = YES;
- UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(youpaifclickImgAction)];
- [_youpaipimgV addGestureRecognizer:tap];
-
- UIImageView *closeImage = [UIImageView new];
- [_youpaipimgV addSubview:closeImage];
- [closeImage mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.mas_equalTo(-10);
- make.top.mas_equalTo(5);
- make.size.mas_equalTo(CGSizeMake(32, 32));
- }];
- closeImage.image = [UIImage imageNamed:@"vqu_images_H_home_re_close"];
- closeImage.userInteractionEnabled = YES;
- UITapGestureRecognizer *tap1 = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(youpaifcloseImageClick)];
- [closeImage addGestureRecognizer:tap1];
- }
- -(void)youpaifcloseImageClick{
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- -(void)youpaifclickImgAction
- {
- [self.youpaipdelegate youpaifclickAdverImage:self.youpaiplink_type andUrl:self.youpaiplink_url];
- [self dismissViewControllerAnimated:YES completion:nil];
- }
- @end
|