No Description

FKSubmitProductHeaderView.m 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // FKSubmitProductHeaderView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/1/27.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKSubmitProductHeaderView.h"
  9. @implementation FKSubmitProductHeaderView
  10. - (instancetype)initWithFrame:(CGRect)frame{
  11. if (self = [super initWithFrame:frame]) {
  12. [self addAllSubviews];
  13. }
  14. return self;
  15. }
  16. - (void)addAllSubviews{
  17. self.backgroundColor = [UIColor whiteColor];
  18. UIView *bottomLine = [[UIView alloc]init];
  19. bottomLine.backgroundColor = UIColorFromRGB(0xe5e5e5);
  20. [self addSubview:self.titleLabel];
  21. [self addSubview:bottomLine];
  22. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  23. make.left.equalTo(self).offset(15);
  24. make.centerY.equalTo(self);
  25. }];
  26. [bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.left.equalTo(self).offset(15);
  28. make.right.bottom.equalTo(self);
  29. make.height.mas_equalTo(0.5);
  30. }];
  31. }
  32. - (UILabel *)titleLabel{
  33. if (_titleLabel == nil) {
  34. _titleLabel = [[UILabel alloc]init];
  35. _titleLabel.font = [UIFont systemFontOfSize:14];
  36. _titleLabel.textColor = UIColorFromRGB(0x333333);
  37. }
  38. return _titleLabel;
  39. }
  40. @end