123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133 |
- //
- // FKPointDetailListCell.m
- // FirstLink
- //
- // Created by jack on 16/3/12.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "FKPointDetailListCell.h"
- @interface FKPointDetailListCell ()
- @property (nonatomic, strong) UIView *smallCircleView;
- @property (nonatomic, strong) UIView *bigCircelView;
- @property (nonatomic, strong) UIView *vertLine;
- @end
- @implementation FKPointDetailListCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]){
- [self addAllSubviews];
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.contentView.backgroundColor = [UIColor clearColor];
- self.backgroundColor = [UIColor clearColor];
- self.backgroundView = nil;
- }
- return self;
- }
- - (void)addAllSubviews{
-
- [self.contentView addSubview:self.addPointLabel];
- [self.contentView addSubview:self.sourceLabel];
- [self.contentView addSubview:self.timeLabel];
- [self.contentView addSubview:self.vertLine];
- [self.contentView addSubview:self.smallCircleView];
- [self.contentView addSubview:self.bigCircelView];
- [self.smallCircleView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.contentView).offset(40);
- make.top.equalTo(self.contentView).offset(20);
- make.width.height.mas_equalTo(8);
- }];
-
- [self.bigCircelView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.center.equalTo(self.smallCircleView);
- make.width.height.mas_equalTo(13);
- }];
-
- [self.vertLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self.smallCircleView);
- // make.top.equalTo(self.contentView);
- make.top.equalTo(self.smallCircleView.mas_bottom);
- make.bottom.equalTo(self.contentView).offset(30);
- make.width.mas_equalTo(0.5);
- }];
-
- [self.addPointLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.contentView).offset(10);
- make.left.equalTo(self.bigCircelView.mas_right).offset(15);
- }];
-
- [self.sourceLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.addPointLabel);
- make.right.equalTo(self.contentView).offset(- 15);
- make.top.equalTo(self.addPointLabel.mas_bottom).offset(15);
- }];
-
- [self.timeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.addPointLabel);
- make.top.equalTo(self.sourceLabel.mas_bottom).offset(7);
- }];
- }
- #pragma mark - property
- - (UILabel *)addPointLabel{
- if (_addPointLabel == nil) {
- _addPointLabel = [[UILabel alloc]init];
- _addPointLabel.font = [UIFont boldSystemFontOfSize:24];
- _addPointLabel.textColor = UIColorFromRGB(0x333333);
- }
- return _addPointLabel;
- }
- - (UILabel *)sourceLabel{
- if (_sourceLabel == nil) {
- _sourceLabel = [[UILabel alloc]init];
- _sourceLabel.font = [UIFont systemFontOfSize:14];
- _sourceLabel.textColor = UIColorFromRGB(0x333333);
- _sourceLabel.lineBreakMode = NSLineBreakByTruncatingTail;
- }
- return _sourceLabel;
- }
- - (UILabel *)timeLabel{
- if (_timeLabel == nil) {
- _timeLabel = [[UILabel alloc]init];
- _timeLabel.font = [UIFont systemFontOfSize:14];
- _timeLabel.textColor = UIColorFromRGB(0x999999);
- }
- return _timeLabel;
- }
- - (UIView *)smallCircleView{
- if (_smallCircleView == nil) {
- _smallCircleView = [[UIView alloc]init];
- _smallCircleView.backgroundColor = UIColorFromRGB(0xff6362);
- _smallCircleView.layer.cornerRadius = 4;
- }
- return _smallCircleView;
- }
- - (UIView *)bigCircelView{
- if (_bigCircelView == nil) {
- _bigCircelView = [[UIView alloc]init];
- _bigCircelView.backgroundColor = [UIColorFromRGB(0xff6362) colorWithAlphaComponent:0.2];
- _bigCircelView.layer.cornerRadius = 6.5;
- }
- return _bigCircelView;
- }
- - (UIView *)vertLine{
- if (_vertLine == nil) {
- _vertLine = [[UIView alloc]init];
- _vertLine.backgroundColor = UIColorFromRGB(0xff6362);
- }
- return _vertLine;
- }
- @end
|