酷店

UIButton+WSLTitleImage.h 878B

12345678910111213141516171819202122232425262728
  1. //
  2. // UIButton+WSLTitleImage.h
  3. // collectionView
  4. //
  5. // Created by 王双龙 on 2017/11/6.
  6. // Copyright © 2017年 王双龙. All rights reserved.
  7. //
  8. #import <UIKit/UIKit.h>
  9. typedef NS_ENUM(NSInteger, WSLButtonStyle) {
  10. WSLButtonStyleImageLeft = 0, /** 默认 图片在左,文字在右 */
  11. WSLButtonStyleImageRight = 1, /** 图片在右,文字在左 */
  12. WSLButtonStyleImageTop = 2, /** 图片在上,文字在下 */
  13. WSLButtonStyleImageBottom = 3 /** 图片在下,文字在上 */
  14. };
  15. @interface UIButton (WSLTitleImage)
  16. /**
  17. * 注意:这个方法需要在设置图片和文字之后才可以调用,且button的大小要大于 图片大小+文字大小+spacing
  18. * @param spacing 图片和文字的间隔
  19. */
  20. - (void)setButtonStyle:(WSLButtonStyle)buttonStyle spacing:(CGFloat)spacing;
  21. @end