// // FKCirDetailCommentHeadView.m // FirstLink // // Created by jack on 16/6/15. // Copyright © 2016年 FirstLink. All rights reserved. // #import "FKCirDetailCommentHeadView.h" @interface FKCirDetailCommentHeadView () @property (nonatomic, strong) UILabel *leftLabel; @property (nonatomic, strong) UIView *bottomLine; @end @implementation FKCirDetailCommentHeadView - (instancetype)initWithReuseIdentifier:(NSString *)reuseIdentifier{ if (self = [super initWithReuseIdentifier:reuseIdentifier]) { [self addAllSubviews]; self.contentView.backgroundColor = [UIColor whiteColor]; } return self; } - (void)addAllSubviews{ [self.contentView addSubview:self.leftLabel]; [self.contentView addSubview:self.rightBtn]; [self.contentView addSubview:self.bottomLine]; [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(15); make.centerY.equalTo(self.contentView); }]; [self.rightBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.contentView).offset(- 15); make.centerY.equalTo(self.contentView); make.height.equalTo(self.contentView); }]; [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self.contentView).offset(15); make.width.mas_equalTo(UISCREENWIDTH - 15); make.bottom.equalTo(self.contentView); make.height.mas_equalTo(0.5); }]; } - (UILabel *)leftLabel{ if (_leftLabel == nil) { _leftLabel = [[UILabel alloc]init]; _leftLabel.font = [UIFont systemFontOfSize:14]; _leftLabel.textColor = UIColorFromRGB(0x333333); _leftLabel.text = @"评论"; } return _leftLabel; } - (UIButton *)rightBtn{ if (_rightBtn == nil) { _rightBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [_rightBtn setTitle:@"查看所有评论" forState:UIControlStateNormal]; [_rightBtn setTitleColor:UIColorFromRGB(0x9b9b9b) forState:UIControlStateNormal]; _rightBtn.titleLabel.font = [UIFont systemFontOfSize:13]; _rightBtn.hidden = YES; } return _rightBtn; } - (UIView *)bottomLine{ if (_bottomLine == nil) { _bottomLine = [[UIView alloc]init]; _bottomLine.backgroundColor = UIColorFromRGB(0xf4f4f4); } return _bottomLine; } @end