//
//  MyTableViewCell_d.m
//  Open
//
//  Created by 看看智能 on 2019/3/17.
//  Copyright © 2019 黄江涛 . All rights reserved.
//

#import "MyTableViewCell_d.h"
#import "Constants.h"

@implementation MyTableViewCell_d

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
//        self.imageleft = [[UIImageView alloc]init];
//        [self.contentView addSubview:self.imageleft];
//        self.imageright = [[UIImageView alloc]init];
//        [self.contentView addSubview:self.imageright];
        [self.contentView addSubview:self.imageleft];
        [self.contentView addSubview:self.imageright];
        [self.contentView addSubview:self.lb_line];
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI{
    [self.imageleft mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset( 10 );
        make.top.bottom.offset(0);
        make.width.offset((ScreenWidth - 30)/2.0);
    }];
    [self.imageright mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-10);
        make.top.bottom.offset(0);
        make.width.offset((ScreenWidth - 30)/2.0);
    }];
    
    [self.lb_line mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self.contentView).offset(5);
        make.width.offset(1);
        make.top.offset(10);
        make.bottom.offset(-10);
    }];
}


#pragma mark - setters and getters
- (UIImageView *)imageleft
{
    if (!_imageleft) {
        _imageleft = [[UIImageView alloc]init];
    }
    return _imageleft;
}

- (UIImageView *)imageright
{
    if (!_imageright) {
        _imageright = [[UIImageView alloc]init];
    }
    return _imageright;
}

- (UIView *)lb_line
{
    if (!_lb_line) {
        _lb_line = [[UIView alloc]init];
        _lb_line.backgroundColor = [UIColor colorWithHex:0xcccccc];
    }
    return _lb_line;
}




- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
