口袋优选

KBCountHeaderView.m 1.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // KBCountHeaderView.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/1/17.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "KBCountHeaderView.h"
  9. #import "KBCountDownView.h"
  10. @interface KBCountHeaderView ()
  11. @property (nonatomic, strong) UIView *bgView;
  12. @end
  13. @implementation KBCountHeaderView
  14. - (instancetype)initWithFrame:(CGRect)frame {
  15. self = [super initWithFrame:frame];
  16. if (self) {
  17. [self initSubViews];
  18. }
  19. return self;
  20. }
  21. - (void)initSubViews {
  22. self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
  23. self.bgView.backgroundColor = [UIColor whiteColor];
  24. UIImageView *logo = [[UIImageView alloc] initWithFrame:CGRectMake(-2, Fitsize(13), Fitsize(138), Fitsize(34))];
  25. logo.image = [UIImage imageNamed:@"hot_web"];
  26. [self.bgView addSubview:logo];
  27. // [self.countDownView setEndTimer:@"0"];
  28. self.countDownView = [KBCountDownView shareInstace];
  29. self.countDownView.x = logo.width+20;
  30. self.countDownView.centerY = logo.centerY;
  31. [self.bgView addSubview:self.countDownView];
  32. [self addSubview:self.bgView];
  33. }
  34. - (void)setCountDownNumber:(NSString *)number {
  35. [self.countDownView setEndTimer:number];
  36. }
  37. @end