Files
keyboard/keyBoard/Class/Common/V/KBImagePositionButton.h
2026-01-27 18:53:19 +08:00

40 lines
990 B
Objective-C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// KBImagePositionButton.h
// keyBoard
//
// Created by Kiro on 2026/1/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
/// 图片位置枚举
typedef NS_ENUM(NSInteger, KBImagePosition) {
KBImagePositionTop, // 图片在上,文字在下
KBImagePositionBottom, // 图片在下,文字在上
KBImagePositionLeft, // 图片在左,文字在右(默认)
KBImagePositionRight // 图片在右,文字在左
};
/// 可以指定图片位置的按钮
@interface KBImagePositionButton : UIButton
/// 图片位置(默认 KBImagePositionLeft
@property (nonatomic, assign) KBImagePosition imagePosition;
/// 图片和文字之间的间距(默认 8
@property (nonatomic, assign) CGFloat spacing;
/**
便捷初始化方法
@param imagePosition 图片位置
@param spacing 图片和文字之间的间距
*/
- (instancetype)initWithImagePosition:(KBImagePosition)imagePosition spacing:(CGFloat)spacing;
@end
NS_ASSUME_NONNULL_END