Brak opisu

AllWebControl.m 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // AllWebsiteControl.m
  3. // FirstLink
  4. //
  5. // Created by 施昌鹏 on 16/8/17.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "AllWebControl.h"
  9. @interface AllWebControl ()
  10. @property (nonatomic, strong) UIImageView *arrowImageView;
  11. @end
  12. @implementation AllWebControl
  13. -(instancetype)initWithFrame:(CGRect)frame {
  14. self = [super initWithFrame:frame];
  15. if (self) {
  16. [self addAllSubviews];
  17. }
  18. return self;
  19. }
  20. -(void)addAllSubviews {
  21. [self addSubview:self.websiteLabel];
  22. [self addSubview:self.arrowImageView];
  23. [self.websiteLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  24. make.top.bottom.equalTo(self);
  25. make.centerX.equalTo(self).offset(-8);
  26. }];
  27. [self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  28. make.left.equalTo(self.websiteLabel.mas_right).offset(5);
  29. make.centerY.equalTo(self);
  30. }];
  31. }
  32. -(UILabel *)websiteLabel {
  33. if (_websiteLabel == nil) {
  34. _websiteLabel = [[UILabel alloc] init];
  35. _websiteLabel.font = [UIFont systemFontOfSize:13];
  36. _websiteLabel.textColor = UIColorFromRGB(0x999999);
  37. _websiteLabel.text = @"点击查看所有网站";
  38. }
  39. return _websiteLabel;
  40. }
  41. -(UIImageView *)arrowImageView {
  42. if (_arrowImageView == nil) {
  43. _arrowImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"next"]];
  44. }
  45. return _arrowImageView;
  46. }
  47. @end