XLsn0wScrollUnderlineButton.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #import <UIKit/UIKit.h>
  2. typedef void(^ScrollUnderlineButtonBlock)(NSUInteger selectedIndex);
  3. @interface XLsn0wScrollUnderlineButton : UIView
  4. @property (nonatomic, copy) ScrollUnderlineButtonBlock scrollUnderlineButtonBlock;
  5. @property (nonatomic, strong) UIView *lineView;///底部标识线
  6. @property (nonatomic, copy) NSArray *titles;
  7. @property (nonatomic, strong) UIColor *selectedColor;
  8. @property (nonatomic, strong) UIColor *normalColor;
  9. @property (nonatomic, strong) UIFont *selectedFont;
  10. @property (nonatomic, strong) UIFont *normalFont;
  11. /**
  12. * 当前选中的index。可以设置当前的index
  13. */
  14. @property (nonatomic, assign) NSInteger currentIndex;
  15. /**
  16. * 分割线位置调整。总是居中显示 默认(0,3,2,3)
  17. 分割线默认高度为3, left可调整宽度,top可调整高度,bottom可调整lineView的y值
  18. */
  19. @property (nonatomic, assign) UIEdgeInsets lineEdgeInsets;
  20. /**
  21. * 选择区域调整。默认(0,10,0,10)
  22. */
  23. @property (nonatomic, assign) UIEdgeInsets cursorEdgeInsets;
  24. /**
  25. * 必须调用此方法来绘制界面
  26. */
  27. -(void)reloadData;
  28. @end
  29. /****************************XLsn0wScrollUnderlineButtonCell****************************************/
  30. @interface XLsn0wScrollUnderlineButtonCell : UICollectionViewCell
  31. @property (nonatomic, copy) NSString *title;
  32. @property (nonatomic, strong) UIColor *selectedColor;//默认分别是 [UIColor redColor],[UIColor whiteColor]
  33. @property (nonatomic, strong) UIColor *normalColor;
  34. @property (nonatomic, strong) UIFont *selectedFont;//默认都是14号字体
  35. @property (nonatomic, strong) UIFont *normalFont;
  36. @end
  37. /****************************XLsn0wScrollUnderlineButtonCell****************************************/