美文网首页
底部试图

底部试图

作者: 全世界妳最美 | 来源:发表于2019-01-21 18:32 被阅读2次
    #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
    

    相关文章

      网友评论

          本文标题:底部试图

          本文链接:https://www.haomeiwen.com/subject/qbfgvftx.html