美文网首页
仿微信朋友圈

仿微信朋友圈

作者: 载你走 | 来源:发表于2018-04-16 09:13 被阅读0次

    #import "IIITableViewController.h"

    @interface IIITableViewController ()

    @end

    @implementation IIITableViewController

    - (UIImageView *)imgView{

        if (!_imgView) {

            _imgView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5, 60, 60)];

            _imgView.layer.cornerRadius = 30;

            _imgView.layer.masksToBounds = YES;

        }

        return _imgView;

    }

    - (UILabel *)titleLabel{

        if (!_titleLabel) {

            _titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 5, 80, 20)];

            _titleLabel.font = [UIFont systemFontOfSize:15];

        }

        return _titleLabel;

    }

    -(UILabel *)subTitleLabel{

        if (!_subTitleLabel) {

            _subTitleLabel = [[UILabel alloc]initWithFrame:CGRectMake(70, 30, 300, 20)];

            _subTitleLabel.textColor = [UIColor lightGrayColor];

            _subTitleLabel.font = [UIFont systemFontOfSize:12];

        }

        return _subTitleLabel;

    }

    -(UILabel *)timeLabel{

        if (!_timeLabel) {

            _timeLabel = [[UILabel alloc]initWithFrame:CGRectMake(320, 10, 80, 20)];

            _timeLabel.textColor = [UIColor lightGrayColor];

        }

        return _timeLabel;

    }

    -(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{

        if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {

            [self addSubview:self.imgView];

            [self addSubview:self.titleLabel];

            [self addSubview:self.subTitleLabel];

            [self addSubview:self.timeLabel];

        }

        return  self;

    }

    相关文章

      网友评论

          本文标题:仿微信朋友圈

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