口袋优选

TADotView.m 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. //
  2. // TADotView.m
  3. // TAPageControl
  4. //
  5. // Created by Tanguy Aladenise on 2015-01-22.
  6. // Copyright (c) 2015 Tanguy Aladenise. All rights reserved.
  7. //
  8. #import "TADotView.h"
  9. @implementation TADotView
  10. - (instancetype)init
  11. {
  12. self = [super init];
  13. if (self) {
  14. [self initialization];
  15. }
  16. return self;
  17. }
  18. - (id)initWithFrame:(CGRect)frame
  19. {
  20. self = [super initWithFrame:frame];
  21. if (self) {
  22. [self initialization];
  23. }
  24. return self;
  25. }
  26. - (id)initWithCoder:(NSCoder *)aDecoder
  27. {
  28. self = [super initWithCoder:aDecoder];
  29. if (self) {
  30. [self initialization];
  31. }
  32. return self;
  33. }
  34. - (void)initialization
  35. {
  36. self.backgroundColor = [UIColor clearColor];
  37. self.layer.cornerRadius = CGRectGetWidth(self.frame) / 2;
  38. self.layer.borderColor = [UIColor whiteColor].CGColor;
  39. self.layer.borderWidth = 2;
  40. }
  41. - (void)changeActivityState:(BOOL)active
  42. {
  43. if (active) {
  44. self.backgroundColor = [UIColor whiteColor];
  45. } else {
  46. self.backgroundColor = [UIColor clearColor];
  47. }
  48. }
  49. @end