YOUPAILZBubbleDressHeaderView.m 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. //
  2. // YOUPAILZBubbleDressHeaderView.m
  3. // VQU
  4. //
  5. // Created by CY on 2021/8/18.
  6. // Copyright © 2021 MS. All rights reserved.
  7. //
  8. #import "YOUPAILZBubbleDressHeaderView.h"
  9. #import "SNKNinePatchImageView.h"
  10. @interface YOUPAILZBubbleDressHeaderView ()
  11. @property (nonatomic, weak) SNKNinePatchImageView *youpaipbubbleImgV;
  12. @end
  13. @implementation YOUPAILZBubbleDressHeaderView
  14. - (instancetype)initWithFrame:(CGRect)frame{
  15. if (self = [super initWithFrame:frame]) {
  16. [self youpaifinitUI];
  17. }
  18. return self;
  19. }
  20. - (void)youpaifinitUI{
  21. UIImageView *bgImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_ic_profile_dress_bg"]];
  22. [self addSubview:bgImgV];
  23. [bgImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.left.top.bottom.right.offset(0.0f);
  25. }];
  26. bgImgV.userInteractionEnabled = YES;
  27. SNKNinePatchImageView *bubbleImgV = [SNKNinePatchImageView new];
  28. bubbleImgV.imageScale = 2;
  29. [self addSubview:bubbleImgV];
  30. self.youpaipbubbleImgV = bubbleImgV;
  31. // [bubbleImgV mas_makeConstraints:^(MASConstraintMaker *make) {
  32. // make.top.offset(ScaleSize(56.0f));
  33. // make.centerX.equalTo(self);
  34. // make.height.offset(55.0f);
  35. // }];
  36. UILabel *contentL = [[UILabel alloc] init];
  37. contentL.font = LCFont(14.0f);
  38. contentL.textColor = [UIColor whiteColor];
  39. contentL.text = @"你好,很高兴认识你哦~";
  40. [self addSubview:contentL];
  41. [contentL mas_makeConstraints:^(MASConstraintMaker *make) {
  42. make.centerY.equalTo(self);
  43. make.centerX.equalTo(self);
  44. }];
  45. [bubbleImgV addConstraintsWithPaddingView:contentL];
  46. // bubbleImgV.ninePatchImage = [SNKNinePatchImage ninePatchImageWithName:@"test1"];
  47. // UILabel *descL = [[UILabel alloc] initWithFrame:CGRectMake(0.0f, 0.0f, 67.0f, 23.0f)];
  48. // descL.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.09f];
  49. // descL.text = @"预览效果";
  50. // descL.textColor = [UIColor whiteColor];
  51. // descL.textAlignment = NSTextAlignmentCenter;
  52. // descL.font = LCFont(11.0f);
  53. // [LCTools clipCorner:UIRectCornerTopRight|UIRectCornerBottomRight View:descL size:CGSizeMake(11.5f, 11.5f)];
  54. // [self addSubview:descL];
  55. // [descL mas_makeConstraints:^(MASConstraintMaker *make) {
  56. // make.left.offset(0.0f);
  57. // make.top.offset(17.0f);
  58. // make.size.mas_offset(CGSizeMake(67.0f, 23.0f));
  59. // }];
  60. }
  61. - (void)youpaifreloadWithModel:(YOUPAILZDressModel *)model{
  62. [self.youpaipbubbleImgV setImageWithUrlStr:[LCTools getImageUrlWithAddress:model.youpaipfile].absoluteString];
  63. // [[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) {
  64. // self.bubbleImgV.image = [image resizableImageWithCapInsets:UIEdgeInsetsMake(15, 15, 15, 15) resizingMode:UIImageResizingModeStretch];
  65. // }];
  66. }
  67. @end