// // YOUPAILZBubbleDressHeaderView.m // VQU // // Created by CY on 2021/8/18. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAILZBubbleDressHeaderView.h" #import "SNKNinePatchImageView.h" @interface YOUPAILZBubbleDressHeaderView () @property (nonatomic, weak) SNKNinePatchImageView *youpaipbubbleImgV; @end @implementation YOUPAILZBubbleDressHeaderView - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ UIImageView *bgImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_profile_dress_bg"]]; [self addSubview:bgImgV]; [bgImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.bottom.right.offset(0.0f); }]; bgImgV.userInteractionEnabled = YES; SNKNinePatchImageView *bubbleImgV = [SNKNinePatchImageView new]; bubbleImgV.imageScale = 2; [self addSubview:bubbleImgV]; self.youpaipbubbleImgV = bubbleImgV; // [bubbleImgV mas_makeConstraints:^(MASConstraintMaker *make) { // make.top.offset(ScaleSize(56.0f)); // make.centerX.equalTo(self); // make.height.offset(55.0f); // }]; UILabel *contentL = [[UILabel alloc] init]; contentL.font = LCFont(14.0f); contentL.textColor = [UIColor whiteColor]; contentL.text = @"你好,很高兴认识你哦~"; [self addSubview:contentL]; [contentL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self); make.centerX.equalTo(self); }]; [bubbleImgV addConstraintsWithPaddingView:contentL]; // bubbleImgV.ninePatchImage = [SNKNinePatchImage ninePatchImageWithName:@"test1"]; // UILabel *descL = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 67.0f, 23.0f)]; // descL.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.09f]; // descL.text = @"预览效果"; // descL.textColor = [UIColor whiteColor]; // descL.textAlignment = NSTextAlignmentCenter; // descL.font = LCFont(11.0f); // [LCTools clipCorner:UIRectCornerTopRight|UIRectCornerBottomRight View:descL size:CGSizeMake(11.5f, 11.5f)]; // [self addSubview:descL]; // [descL mas_makeConstraints:^(MASConstraintMaker *make) { // make.left.offset(0.0f); // make.top.offset(17.0f); // make.size.mas_offset(CGSizeMake(67.0f, 23.0f)); // }]; } - (void)youpaifreloadWithModel:(YOUPAILZDressModel *)model{ [self.youpaipbubbleImgV setImageWithUrlStr:[LCTools getImageUrlWithAddress:model.youpaipfile].absoluteString]; // [[SDWebImageDownloader sharedDownloader] downloadImageWithURL:[LCTools getImageUrlWithAddress:model.file] options:SDWebImageDownloaderUseNSURLCache progress:^(NSInteger receivedSize, NSInteger expectedSize, NSURL * _Nullable targetURL) {} completed:^(UIImage * _Nullable image, NSData * _Nullable data, NSError * _Nullable error, BOOL finished) { // self.bubbleImgV.image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(15, 15, 15, 15) resizingMode:UIImageResizingModeStretch]; // }]; } @end