Files
midi_ios/QXLive/Mine(音域)/View/QXMyHistoryHeaderView.m

46 lines
1.4 KiB
Mathematica
Raw Normal View History

2025-08-14 10:07:49 +08:00
//
// QXMyHistoryHeaderView.m
// IsLandVoice
//
// Created by on 2025/4/12.
//
#import "QXMyHistoryHeaderView.h"
@implementation QXMyHistoryHeaderView
- (instancetype)init
{
self = [super init];
if (self) {
self.frame = CGRectMake(0, 0, SCREEN_WIDTH, 46);
[self createViews];
}
return self;
}
-(void)createViews{
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"history_icon"]];
imageView.frame = CGRectMake(16, 0, 13, 13);
imageView.centerY = self.centerY;
[self addSubview:imageView];
UILabel *titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(imageView.right+6, 0, 150, 24)];
titleLabel.centerY = self.centerY;
titleLabel.text = @"历史足迹";
titleLabel.textColor = [UIColor colorWithHexString:@"#333333"];
titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self addSubview:titleLabel];
UIButton *clearBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.width-self.height, 0, self.height, self.height)];
[clearBtn addTarget:self action:@selector(clearAction) forControlEvents:(UIControlEventTouchUpInside)];
[clearBtn setImage:[UIImage imageNamed:@"room_history_delete"] forState:(UIControlStateNormal)];
[self addSubview:clearBtn];
}
-(void)clearAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(didClickClearBtn)]) {
[self.delegate didClickClearBtn];
}
}
@end