暂无描述

FKSelectAlertView.m 1.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //
  2. // FKSelectAlertView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/4/8.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKSelectAlertView.h"
  9. @interface FKSelectAlertView ()
  10. @property (nonatomic, strong) UILabel *contentLabel;
  11. @end
  12. @implementation FKSelectAlertView
  13. - (instancetype)initWithFrame:(CGRect)frame{
  14. if (self = [super initWithFrame:frame]) {
  15. [self addAllSubviews];
  16. }
  17. return self;
  18. }
  19. - (void)addAllSubviews{
  20. self.backgroundColor = UIColorFromRGB(0xf4f4f4);
  21. [self addSubview:self.contentLabel];
  22. [self.contentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  23. make.left.equalTo(self).offset(15);
  24. make.right.equalTo(self).offset(- 15);
  25. make.centerY.equalTo(self);
  26. }];
  27. }
  28. - (UILabel *)contentLabel{
  29. if (_contentLabel == nil) {
  30. _contentLabel = [[UILabel alloc]init];
  31. _contentLabel.textColor = UIColorFromRGB(0x999999);
  32. _contentLabel.font = [UIFont systemFontOfSize:12];
  33. _contentLabel.numberOfLines = 0;
  34. NSString *title = @"温馨提示:以上信息均由海外官网提供,仅供参考,恕不接受色差尺码问题的退换货。";
  35. NSMutableAttributedString *attM = [[NSMutableAttributedString alloc]initWithString:title];
  36. [attM addAttribute:NSForegroundColorAttributeName value:UIColorFromRGB(0xff624a) range:NSMakeRange(0, 5)];
  37. _contentLabel.attributedText = attM;
  38. }
  39. return _contentLabel;
  40. }
  41. @end