You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
99 lines
3.5 KiB
99 lines
3.5 KiB
4 years ago
|
//
|
||
|
// TFButton.h
|
||
|
// TFReader
|
||
|
//
|
||
|
// Created by 谢腾飞 on 2020/12/16.
|
||
|
// Copyright © 2020 xtfei_2011@126.com. All rights reserved.
|
||
|
//
|
||
|
|
||
|
#import <UIKit/UIKit.h>
|
||
|
|
||
|
NS_ASSUME_NONNULL_BEGIN
|
||
|
|
||
|
typedef NS_ENUM(NSUInteger, TFButtonIndicator) {
|
||
|
TFButtonIndicatorTitleLeft, // 文字左 图片右
|
||
|
TFButtonIndicatorTitleRight, // 文字右 图片左
|
||
|
TFButtonIndicatorTitleTop, // 文字上 图片下
|
||
|
TFButtonIndicatorTitleBottom, // 文字下 图片上
|
||
|
TFButtonIndicatorImageLeftBothLeft, // 图片左 文字右 (同时靠左)
|
||
|
TFButtonIndicatorImageLeftBothRight, // 图片左 文字右 (同时靠右)
|
||
|
TFButtonIndicatorImageRightBothLeft, // 文字左 图片右 (同时靠左)
|
||
|
TFButtonIndicatorImageRightBothRight // 文字左 图片右 (同时靠右)
|
||
|
};
|
||
|
|
||
|
@interface TFButton : UIButton
|
||
|
|
||
|
// 主标题
|
||
|
@property (nonatomic ,copy) NSString *buttonTitle;
|
||
|
// 子标题
|
||
|
@property (nonatomic ,copy) NSString *buttonSubTitle;
|
||
|
// 主标题字号
|
||
|
@property (nonatomic ,strong) UIFont *buttonTitleFont;
|
||
|
// 子标题字号
|
||
|
@property (nonatomic ,strong) UIFont *buttonSubTitleFont;
|
||
|
|
||
|
|
||
|
// 主标题颜色
|
||
|
@property (nonatomic ,strong) UIColor *buttonTitleColor;
|
||
|
// 子标题颜色
|
||
|
@property (nonatomic ,strong) UIColor *buttonSubTitleColor;
|
||
|
// 整体颜色 (与buttonTitleColor && buttonSubTitleColor 互斥)
|
||
|
@property (nonatomic ,strong) UIColor *buttonTintColor;
|
||
|
|
||
|
|
||
|
// 按钮图片名称
|
||
|
@property (nonatomic ,copy) NSString *buttonImageName;
|
||
|
|
||
|
|
||
|
// 图片宽度
|
||
|
@property (nonatomic ,assign) NSInteger buttonImageViewWidth;
|
||
|
// 图片高度
|
||
|
@property (nonatomic ,assign) NSInteger buttonImageViewHeight;
|
||
|
// 图片缩放 默认0.7 最大为1.0
|
||
|
@property (nonatomic ,assign) CGFloat buttonImageScale;
|
||
|
// 图文间距 默认 10
|
||
|
@property (nonatomic ,assign) NSInteger graphicDistance;
|
||
|
// 整体偏移量 正数为整体向右偏移 负数为整体向左偏移
|
||
|
@property (nonatomic ,assign) CGFloat horizontalMigration;
|
||
|
// 边距 默认0
|
||
|
@property (nonatomic ,assign) CGFloat buttonMargin;
|
||
|
|
||
|
|
||
|
// 角标背景颜色
|
||
|
@property (nonatomic ,strong) UIColor *cornerBackColor;
|
||
|
// 角标文字颜色
|
||
|
@property (nonatomic ,strong) UIColor *cornerTextColor;
|
||
|
// 角标字号
|
||
|
@property (nonatomic ,strong) UIFont *cornerTextFont;
|
||
|
// 角标文字
|
||
|
@property (nonatomic ,copy) NSString *cornerTitle;
|
||
|
|
||
|
|
||
|
// 是否翻转图片
|
||
|
@property (nonatomic ,assign) BOOL transformImageView;
|
||
|
// 主标题显示行数 默认一行
|
||
|
@property (nonatomic ,assign) NSInteger buttonTitleNumberOfLines;
|
||
|
// 按钮标识
|
||
|
@property (nonatomic ,copy) NSString *buttonTag;
|
||
|
|
||
|
|
||
|
- (instancetype)initWithButtonTitle:(NSString *)buttonTitle buttonImageName:(NSString *)buttonImageName buttonIndicator:(TFButtonIndicator)buttonIndicatior;
|
||
|
|
||
|
- (instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle buttonImageName:(NSString *)buttonImageName buttonIndicator:(TFButtonIndicator)buttonIndicatior;
|
||
|
|
||
|
- (instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle buttonImageName:(NSString *)buttonImageName buttonIndicator:(TFButtonIndicator)buttonIndicatior showMaskView:(BOOL)showMaskView;
|
||
|
|
||
|
- (instancetype)initWithFrame:(CGRect)frame buttonTitle:(NSString *)buttonTitle buttonSubTitle:(NSString *)buttonSubTitle buttonImageName:(NSString *)buttonImageName buttonIndicator:(TFButtonIndicator)buttonIndicatior showMaskView:(BOOL)showMaskView;
|
||
|
|
||
|
|
||
|
// 撤销遮盖层
|
||
|
- (void)undoMaskView;
|
||
|
// 图片 开始旋转
|
||
|
- (void)startSpin;
|
||
|
// 图片 停止旋转
|
||
|
- (void)stopSpin;
|
||
|
|
||
|
@end
|
||
|
|
||
|
NS_ASSUME_NONNULL_END
|