TYPageControl.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. //
  2. // TYPageControl.h
  3. // TYCyclePagerViewDemo
  4. //
  5. // Created by tany on 2017/6/20.
  6. // Copyright © 2017年 tany. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. NS_ASSUME_NONNULL_BEGIN
  10. @interface TYPageControl : UIControl
  11. @property (nonatomic, assign) NSInteger numberOfPages; // default is 0
  12. @property (nonatomic, assign) NSInteger currentPage; // default is 0. value pinned to 0..numberOfPages-1
  13. @property (nonatomic, assign) BOOL hidesForSinglePage; // hide the the indicator if there is only one page. default is NO
  14. @property (nonatomic, assign) CGFloat pageIndicatorSpaing;
  15. @property (nonatomic, assign) UIEdgeInsets contentInset; // center will ignore this
  16. @property (nonatomic, assign ,readonly) CGSize contentSize; // real content size
  17. // override super
  18. //@property (nonatomic, assign) UIControlContentVerticalAlignment contentVerticalAlignment; // how to position content vertically inside control. default is center
  19. //@property (nonatomic, assign) UIControlContentHorizontalAlignment contentHorizontalAlignment; // how to position content hozontally inside control. default is center
  20. // indicatorTint color
  21. @property (nullable, nonatomic,strong) UIColor *pageIndicatorTintColor;
  22. @property (nullable, nonatomic,strong) UIColor *currentPageIndicatorTintColor;
  23. // indicator image
  24. @property (nullable, nonatomic,strong) UIImage *pageIndicatorImage;
  25. @property (nullable, nonatomic,strong) UIImage *currentPageIndicatorImage;
  26. @property (nonatomic, assign) UIViewContentMode indicatorImageContentMode; // default is UIViewContentModeCenter
  27. @property (nonatomic, assign) CGSize pageIndicatorSize; // indicator size
  28. @property (nonatomic, assign) CGSize currentPageIndicatorSize; // default pageIndicatorSize
  29. @property (nonatomic, assign) CGFloat animateDuring; // default 0.3
  30. - (void)setCurrentPage:(NSInteger)currentPage animate:(BOOL)animate;
  31. @end
  32. NS_ASSUME_NONNULL_END