CalenderHeaderView.m 787 B

123456789101112131415161718192021222324252627
  1. //
  2. // CalenderHeaderView.m
  3. // YZCCalender
  4. //
  5. // Created by Jason on 2018/1/18.
  6. // Copyright © 2018年 jason. All rights reserved.
  7. //
  8. #import "CalenderHeaderView.h"
  9. #import "UIColor+Extension.h"
  10. @implementation CalenderHeaderView
  11. - (UILabel *)yearAndMonthLabel {
  12. if (_yearAndMonthLabel == nil) {
  13. _yearAndMonthLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, self.frame.size.height * 0.5 - 30 * 0.5, self.frame.size.width, 30)];
  14. _yearAndMonthLabel.textAlignment = NSTextAlignmentLeft;
  15. _yearAndMonthLabel.font = [UIFont systemFontOfSize:16];
  16. _yearAndMonthLabel.textColor = [UIColor colorWithHexString:@"#999999"];
  17. [self addSubview:_yearAndMonthLabel];
  18. }
  19. return _yearAndMonthLabel;
  20. }
  21. @end