35 lines
949 B
C
35 lines
949 B
C
|
|
//
|
|||
|
|
// UIButton+QX.h
|
|||
|
|
// QXLive
|
|||
|
|
//
|
|||
|
|
// Created by 启星 on 2025/4/28.
|
|||
|
|
//
|
|||
|
|
|
|||
|
|
#import <UIKit/UIKit.h>
|
|||
|
|
|
|||
|
|
NS_ASSUME_NONNULL_BEGIN
|
|||
|
|
typedef NS_ENUM(NSUInteger, QXButtonEdgeInsetsStyle) {
|
|||
|
|
QXButtonEdgeInsetsStyleTop, ///< image在上,label在下
|
|||
|
|
QXButtonEdgeInsetsStyleLeft, ///< image在左,label在右
|
|||
|
|
QXButtonEdgeInsetsStyleBottom, ///< image在下,label在上
|
|||
|
|
QXButtonEdgeInsetsStyleRight ///< image在右,label在左
|
|||
|
|
};
|
|||
|
|
@interface UIButton (QX)
|
|||
|
|
|
|||
|
|
/**
|
|||
|
|
设置button的titleLabel和imageView的布局样式及间距
|
|||
|
|
|
|||
|
|
@param style titleLabel和imageView的布局样式
|
|||
|
|
@param space titleLabel和imageView的b间距
|
|||
|
|
*/
|
|||
|
|
- (void)qx_layoutButtonWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyle)style
|
|||
|
|
imageTitleSpace:(CGFloat)space;
|
|||
|
|
|
|||
|
|
- (void)qx_layoutButtonNOSizeToFitWithEdgeInsetsStyle:(QXButtonEdgeInsetsStyle)style
|
|||
|
|
imageTitleSpace:(CGFloat)space;
|
|||
|
|
|
|||
|
|
|
|||
|
|
@end
|
|||
|
|
|
|||
|
|
NS_ASSUME_NONNULL_END
|