底部试图

#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 = [tableView  dequeueReusableHeaderFooterViewWithIdentifier: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

你可能感兴趣的:(底部试图)