Brak opisu

KXLaunchAdSkipButton.m 919B

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // KXLaunchAdSkipButton.m
  3. // CAISHEN
  4. //
  5. // Created by kuxuan on 2017/8/17.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import "KXLaunchAdSkipButton.h"
  9. @implementation KXLaunchAdSkipButton
  10. - (instancetype)initWithFrame:(CGRect)frame
  11. {
  12. if (self == [super initWithFrame:frame]) {
  13. [self setupUI];
  14. }
  15. return self;
  16. }
  17. - (void)setupUI
  18. {
  19. // [self setBackgroundColor:[UIColor colorWithWhite:0 alpha:0.4]];
  20. [self setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
  21. self.titleLabel.font = FONT_SYS(13);
  22. self.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
  23. self.layer.cornerRadius = self.frame.size.height/2.0;
  24. self.layer.masksToBounds = YES;
  25. }
  26. - (void)setDuration:(NSInteger)duration
  27. {
  28. _duration = duration;
  29. [self setTitle:[NSString stringWithFormat:@"倒计时%lds",duration] forState:UIControlStateNormal];
  30. }
  31. @end