SegmentViewController.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. //
  2. // SegmentViewController.h
  3. // CLSegment
  4. //
  5. // Created by CL on 2018/4/9.
  6. // Copyright © 2018年 cl. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSInteger, SegmentHeaderType) {
  10. SegmentHeaderTypeScroll, //标签栏可滚动
  11. SegmentHeaderTypeFixed //标签栏固定
  12. };
  13. typedef NS_ENUM(NSInteger, SegmentControlStyle) {
  14. SegmentControlTypeScroll, //内容部分可滚动
  15. SegmentControlTypeFixed //内容部分固定
  16. };
  17. @interface SegmentViewController : UIViewController
  18. //标签栏标题数组
  19. @property (nonatomic, strong) NSArray *titleArray;
  20. //每个标签对应ViewController数组
  21. @property (nonatomic, strong) NSArray *subViewControllers;
  22. //标签栏背景色
  23. @property (nonatomic, strong) UIColor *headViewBackgroundColor;
  24. //非选中状态下标签字体颜色
  25. @property (nonatomic, strong) UIColor *titleColor;
  26. //选中标签字体颜色
  27. @property (nonatomic, strong) UIColor *titleSelectedColor;
  28. //标签字体大小
  29. @property (nonatomic, assign) CGFloat fontSize;
  30. //标签栏每个按钮高度
  31. @property (nonatomic, assign) CGFloat buttonHeight;
  32. //标签栏每个按钮宽度
  33. @property (nonatomic, assign) CGFloat buttonWidth;
  34. //选中标签下划线高度
  35. @property (nonatomic, assign) CGFloat bottomLineHeight;
  36. //选中标签按钮数量
  37. @property (nonatomic, assign) CGFloat bottomCount;
  38. //选中标签底部划线颜色
  39. @property (nonatomic, strong) UIColor *bottomLineColor;
  40. //标签栏类型,默认为滚动
  41. @property (nonatomic, assign) SegmentHeaderType segmentHeaderType;
  42. //内容类型,默认为滚动
  43. //@property (nonatomic, assign) SegmentControlStyle segmentControlType;
  44. @property (nonatomic, assign) NSInteger selectIndex;
  45. //初始化方法
  46. - (void)initSegment:(CGFloat)height;
  47. //点击标签栏按钮调用方法
  48. - (void)didSelectSegmentIndex:(NSInteger)index;
  49. - (void)addParentController:(UIViewController *)viewController;
  50. @end