- 首页 > it技术 > >
#import "searchHotHistoryHeader.h"
@interface searchHotHistoryHeader ()
@property (nonatomic,strong)UILabel *labtitle;
@end@implementation searchHotHistoryHeader+ (instancetype)TableViewFoot:(UITableView *)tableView{
NSString *cellID = @"searchHotHistoryHeader";
//注册collection 的header;
[tableView registerClass:[searchHotHistoryHeader class] forHeaderFooterViewReuseIdentifier:cellID];
searchHotHistoryHeader *foot = [tableViewdequeueReusableHeaderFooterViewWithIdentifier:cellID];
if (foot == nil) {
foot = [[searchHotHistoryHeader alloc] initWithReuseIdentifier:cellID];
}
//[foot creatUI];
foot.contentView.backgroundColor = [UIColor whiteColor];
return foot;
}
-(instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{
if (self = [super initWithReuseIdentifier:reuseIdentifier]) {
[self creatUI];
}
return self;
}
- (void)creatUI{
UILabel *lab = [[UILabel alloc] init];
self.labtitle = lab;
lab.text = @"热门搜索";
lab.font = font(15);
lab.textColor = [UIColor colorTextGray];
[self.contentView addSubview:lab];
[lab mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(20);
make.height.mas_equalTo(20);
make.centerY.equalTo(self.contentView);
}];
}
- (void)setTitle:(NSString *)title{
_title = title;
self.labtitle.text = title;
}@end
推荐阅读