This commit is contained in:
2025-11-08 20:04:50 +08:00
parent faeb930fe3
commit 3b0beb52da
8 changed files with 620 additions and 17 deletions

View File

@@ -0,0 +1,18 @@
//
// KBHistoryMoreCell.h
// keyBoard
//
// 历史记录第二行尾部的“展开更多”按钮 cell向下箭头
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface KBHistoryMoreCell : UICollectionViewCell
/// 固定尺寸建议(高度与标签一致 32
+ (CGSize)fixedSize;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,56 @@
//
// KBHistoryMoreCell.m
// keyBoard
//
#import "KBHistoryMoreCell.h"
@interface KBHistoryMoreCell ()
@property (nonatomic, strong) UIView *bgView;
@property (nonatomic, strong) UIImageView *iconView;
@end
@implementation KBHistoryMoreCell
- (instancetype)initWithFrame:(CGRect)frame {
if (self = [super initWithFrame:frame]) {
self.contentView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.bgView];
[self.bgView addSubview:self.iconView];
[self.bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.contentView);
}];
[self.iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.equalTo(self.bgView);
make.width.height.mas_equalTo(14);
}];
}
return self;
}
+ (CGSize)fixedSize { return CGSizeMake(32, 32); }
#pragma mark - Lazy
- (UIView *)bgView {
if (!_bgView) {
_bgView = [[UIView alloc] init];
_bgView.backgroundColor = [UIColor colorWithWhite:0.96 alpha:1.0];
_bgView.layer.cornerRadius = 16;
_bgView.layer.masksToBounds = YES;
}
return _bgView;
}
- (UIImageView *)iconView {
if (!_iconView) {
_iconView = [[UIImageView alloc] initWithImage:[UIImage systemImageNamed:@"chevron.down"]];
_iconView.tintColor = [UIColor colorWithHex:0x9A9A9A];
_iconView.contentMode = UIViewContentModeScaleAspectFit;
}
return _iconView;
}
@end