Ei kuvausta

KXCustomPageControl.h 1.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // KXCustomPageControl.h
  3. // CAISHEN
  4. //
  5. // Created by jikaipeng on 2018/5/22.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. @class KXCustomPageControl;
  10. @protocol CusPageControlWithViewDelegate <NSObject>
  11. @optional
  12. -(void)pageControlView:(KXCustomPageControl *)pageControlView indexNum:(NSInteger)indexNum;
  13. @end
  14. @interface KXCustomPageControl : UIView
  15. /**
  16. * 滑动到的下标
  17. */
  18. @property (nonatomic,assign)NSInteger indexNumWithSlide;
  19. /**
  20. * 代理属性
  21. */
  22. @property (nonatomic,weak)id<CusPageControlWithViewDelegate> delegate;
  23. /**
  24. * 创建自定义的PageControl
  25. *
  26. * @param frame frame(宽度一定要大于图片的所有宽度之和,高度大于等于图片的高度,不然会出现你想不到的恶心UI后果)
  27. * @param pageNum 显示的个数(如果是4张就是4)
  28. * @param currentPageIndex 当前显示的下标(0是第一个,所以其值<=(pageNum-1))
  29. * @param currentShowImage 当前显示的图片
  30. * @param pageIndicatorShowImage 接下来显示的图片
  31. *
  32. * @return 自定义PageControl对象
  33. */
  34. -(instancetype)initWithCusPageControl:(CGRect)frame pageNum:(NSInteger)pageNum currentPageIndex:(NSInteger)currentPageIndex currentShowImage:(UIImage *)currentShowImage pageIndicatorShowImage:(UIImage *)pageIndicatorShowImage;
  35. #pragma mark 和上面的方法一样,这个是类方法
  36. +(instancetype)cusPageControlWithView:(CGRect)frame pageNum:(NSInteger)pageNum currentPageIndex:(NSInteger)currentPageIndex currentShowImage:(UIImage *)currentShowImage pageIndicatorShowImage:(UIImage *)pageIndicatorShowImage;
  37. @end