口袋优选

KBSignPopView.m 1.8KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // KBSignPopView.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/9/28.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "KBSignPopView.h"
  9. @implementation KBSignPopView
  10. - (instancetype)initWithFrame:(CGRect)frame text:(NSString *)text {
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. self.layer.cornerRadius = Fitsize(8);
  14. // self.backgroundColor = [UIColor whiteColor];
  15. UIImageView *icon = [[UIImageView alloc] initWithFrame:self.bounds];
  16. icon.contentMode = UIViewContentModeScaleAspectFill;
  17. icon.centerX = self.width/2;
  18. icon.image = [UIImage imageNamed:@"eve_qian"];
  19. [self addSubview:icon];
  20. UILabel *des = [[UILabel alloc] initWithFrame:CGRectMake(10, 0, self.width-20, Fitsize(200))];
  21. des.numberOfLines = 0;
  22. des.textColor = [UIColor YHColorWithHex:0x2A2A2A];
  23. des.font = [UIFont systemFontOfSize:Fitsize(14)];
  24. des.text = text;
  25. [des sizeToFit];
  26. des.centerX = self.width/2;
  27. des.textAlignment = NSTextAlignmentCenter;
  28. des.y = Fitsize(220);
  29. [self addSubview:des];
  30. self.clickBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  31. self.clickBtn.frame = CGRectMake(0, self.height-20-Fitsize(37), FITSIZE(188), FITSIZE(37));
  32. self.clickBtn.hidden = YES;
  33. [self addSubview:self.clickBtn];
  34. self.clickBtn.backgroundColor = [UIColor colorWithHexString:@"#FC1E67"];
  35. [self.clickBtn setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  36. self.clickBtn.layer.masksToBounds = YES;
  37. self.clickBtn.layer.cornerRadius = FITSIZE(5);
  38. [self.clickBtn setTitle:@"签到领红包" forState:UIControlStateNormal];
  39. self.clickBtn.centerX = self.width/2;
  40. }
  41. return self;
  42. }
  43. @end