TDButton.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // TDButton.h
  3. // TheoryNetwork
  4. //
  5. // Created by tederen on 2019/9/20.
  6. // Copyright © 2019 tederen. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSUInteger, GLButtonEdgeInsetsStyle) {
  10. /// image在上,label在下
  11. GLButtonEdgeInsetsStyleTop,
  12. /// image在左,label在右
  13. GLButtonEdgeInsetsStyleLeft,
  14. /// image在下,label在上
  15. GLButtonEdgeInsetsStyleBottom,
  16. /// image在右,label在左
  17. GLButtonEdgeInsetsStyleRight
  18. };
  19. NS_ASSUME_NONNULL_BEGIN
  20. @interface TDButton : UIButton
  21. /** 设置button的响应区域 **/
  22. - (void)setCurrentButtonHotSize:(CGSize)size;
  23. /** 图文排列。必须先确定bounds **/
  24. - (void)verticalImageAndTitle:(CGFloat)spacing;
  25. - (void)setButtonAlpha:(CGFloat)alpha;
  26. - (void)setButtonBadge:(NSInteger)num;
  27. - (void)setButtonBadge:(NSInteger)num isSelect:(BOOL)isSelect;
  28. /**
  29. * 设置button的titleLabel和imageView的布局样式,及间距
  30. *
  31. * @param style titleLabel和imageView的布局样式
  32. * @param space titleLabel和imageView的间距
  33. */
  34. - (void)layoutButtonWithEdgeInsetsStyle:(GLButtonEdgeInsetsStyle)style
  35. imageTitleSpace:(CGFloat)space;
  36. @end
  37. NS_ASSUME_NONNULL_END