| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051 |
- //
- // SQCustomButton.h
- // SQCustomButton
- //
- // Created by yangsq on 2017/9/12.
- // Copyright © 2017年 yangsq. All rights reserved.
- //
- #import <UIKit/UIKit.h>
- NS_ASSUME_NONNULL_BEGIN
- typedef NS_ENUM(NSInteger,SQCustomButtonType) {
- SQCustomButtonLeftImageType,//左图标,右文字
- SQCustomButtonTopImageType,//上图标,下文字
- SQCustomButtonRightImageType//右图标,左文字
- };
- @interface SQCustomButton : UIView
- @property (nonatomic, strong) UIImageView *imageView;
- @property (nonatomic, strong) UILabel *titleLabel;
- @property (nonatomic, assign) BOOL isShowSelectBackgroudColor;//是否展示点击效果
- @property (nonatomic, copy)void(^touchBlock)(SQCustomButton *button);
- /*
- 初始化
- imageSize 图标大小
- isAutoWidth 是否根据文字长度自适应
- */
- - (id)initWithFrame:(CGRect)frame
- type:(SQCustomButtonType)type
- imageSize:(CGSize)imageSize
- midmargin:(CGFloat)midmargin;
- //点击响应
- - (void)touchAction:(void(^)(SQCustomButton *button))block;
- NS_ASSUME_NONNULL_END
- @end
|