// // DetailMoreCommentCell.m // FirstLink // // Created by jack on 15/9/9. // Copyright (c) 2015年 FirstLink. All rights reserved. // #import "DetailMoreCommentCell.h" @interface DetailMoreCommentCell () @property (nonatomic, strong) UILabel *titleLabel; @end @implementation DetailMoreCommentCell - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self addAllSubviews]; self.selectionStyle = UITableViewCellSelectionStyleNone; } return self; } - (void)addAllSubviews{ [self.contentView addSubview:self.titleLabel]; [self.contentView addSubview:self.moreActionBtn]; [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.contentView); make.size.mas_equalTo(CGSizeMake(105, 23)); }]; [self.moreActionBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self.contentView); make.width.mas_equalTo(150); make.height.equalTo(self.contentView); }]; } - (UILabel *)titleLabel{ if (_titleLabel == nil) { _titleLabel = [[UILabel alloc]init]; _titleLabel.font = [UIFont systemFontOfSize:12]; _titleLabel.textColor = UIColorFromRGB(0x999999); _titleLabel.backgroundColor = [UIColor colorWithRed:234 / 255.0 green:234 / 255.0 blue:234 / 255.0 alpha:1.0]; _titleLabel.text = @"查看所有评论"; _titleLabel.layer.cornerRadius = 10; _titleLabel.layer.masksToBounds = YES; _titleLabel.textAlignment = NSTextAlignmentCenter; } return _titleLabel; } - (UIButton *)moreActionBtn{ if (_moreActionBtn == nil) { _moreActionBtn = [UIButton buttonWithType:UIButtonTypeCustom]; } return _moreActionBtn; } @end