CTPageControl.m 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // CTPageControl.m
  3. // AICity
  4. //
  5. // Created by 刘伟伟 on 2023/7/6.
  6. // Copyright © 2023 wei.z. All rights reserved.
  7. //
  8. #import "CTPageControl.h"
  9. @implementation CTPageControl
  10. //- (void)setCurrentPage:(NSInteger)page {
  11. // [super setCurrentPage:page];
  12. // for (NSUInteger subviewIndex = 0; subviewIndex < [self.subviews count]; subviewIndex++) {
  13. // UIView *subview = [self.subviews objectAtIndex:subviewIndex];
  14. // UIImageView *imageView = nil;
  15. // if (subviewIndex == page) {
  16. // CGFloat w = 6;
  17. // CGFloat h = 6;
  18. // imageView = [[UIImageView alloc] initWithFrame:CGRectMake(-1.5, -1.5, w, h)];
  19. // imageView.image = [UIImage imageNamed:@"Ellipse 2"];
  20. // [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y, w, h)];
  21. // } else {
  22. // CGFloat w = 4;
  23. // CGFloat h = 4;
  24. // imageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, w, h)];
  25. // imageView.image = [UIImage imageNamed:@"Ellipse 3"];
  26. // [subview setFrame:CGRectMake(subview.frame.origin.x, subview.frame.origin.y, w, h)];
  27. // }
  28. // imageView.tag = 10010;
  29. // UIImageView *lastImageView = (UIImageView *) [subview viewWithTag:10010];
  30. // [lastImageView removeFromSuperview]; //把上一次添加的view移除
  31. // [subview addSubview:imageView];
  32. // }
  33. //}
  34. @end