123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- //
- // FKRecoNewsListCell.m
- // FirstLink
- //
- // Created by ascii on 2017/6/10.
- // Copyright © 2017年 FirstLink. All rights reserved.
- //
- #import "FKRecoNewsListCell.h"
- @interface FKRecoNewsListCell ()
- @end
- @implementation FKRecoNewsListCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
-
- [self setupViews];
- }
- return self;
- }
- #pragma mark - Method
- - (void)setupViews {
- [self.contentView addSubview:self.headImgView];
- [self.headImgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerY.equalTo(self.contentView);
- make.left.equalTo(self.contentView).offset(12);
- make.size.mas_equalTo(CGSizeMake(59, 59));
- }];
-
- [self.contentView addSubview:self.titleLabel];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.contentView).offset(12);
- make.left.equalTo(self.headImgView.mas_right).offset(19);
- make.right.equalTo(self.contentView).offset(-12);
- }];
-
- [self.contentView addSubview:self.authorLabel];
- [self.authorLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.titleLabel.mas_bottom).offset(4);
- make.left.equalTo(self.titleLabel);
- }];
-
- [self.contentView addSubview:self.bottomLine];
- [self.bottomLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.bottom.right.equalTo(self.contentView);
- make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
- }];
- }
- #pragma mark - Property
- - (UIImageView *)headImgView {
- if (!_headImgView) {
- _headImgView = [UIImageView new];
- _headImgView.contentMode = UIViewContentModeScaleAspectFit;
- _headImgView.layer.cornerRadius = 2;
- }
- return _headImgView;
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [UILabel new];
- _titleLabel.font = [UIFont systemFontOfSize:14];
- _titleLabel.textColor = UIColorFromRGB(0x333333);
- _titleLabel.numberOfLines = 2;
- }
- return _titleLabel;
- }
- - (UILabel *)authorLabel {
- if (!_authorLabel) {
- _authorLabel = [UILabel new];
- _authorLabel.font = [UIFont systemFontOfSize:12];
- _authorLabel.textColor = UIColorFromRGB(0x999999);
- }
- return _authorLabel;
- }
- - (UIView *)bottomLine {
- if (!_bottomLine) {
- _bottomLine = [UIView new];
- _bottomLine.backgroundColor = UIColorFromRGB(0xf4f4f4);
- }
- return _bottomLine;
- }
- @end
|