// // EditAddressCell.m // FirstLink // // Created by ascii on 15/5/28. // Copyright (c) 2015年 FirstLink. All rights reserved. // #import "FKAddressDetailCell.h" @implementation FKAddressDetailCell - (void)setSelected:(BOOL)selected animated:(BOOL)animated { [super setSelected:selected animated:animated]; // Configure the view for the selected state } - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier { self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { [self addAllSubviews]; } return self; } - (void)addAllSubviews { WeakSelf(weakSelf); [self.contentView addSubview:self.tipLabel]; [self.tipLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(weakSelf.contentView).offset(8); make.top.equalTo(weakSelf.contentView).offset(12); make.width.mas_equalTo(82); make.height.mas_equalTo(20); }]; [self.contentView addSubview:self.textView]; [self.textView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(weakSelf.tipLabel.mas_right).offset(8); make.top.equalTo(weakSelf.contentView).offset(4); make.right.equalTo(weakSelf.contentView).offset(-8); make.bottom.equalTo(weakSelf.contentView).offset(-4); make.width.mas_greaterThanOrEqualTo(40); }]; [self.contentView addSubview:self.arrowIcon]; [self.arrowIcon mas_makeConstraints:^(MASConstraintMaker *make) { make.top.equalTo(weakSelf.contentView).with.offset(12); make.right.equalTo(weakSelf.contentView).with.offset(-8); make.width.mas_equalTo(20); make.height.mas_equalTo(20); }]; UIView *line = [self makeNewLine]; [self.contentView addSubview:line]; [line mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(weakSelf.contentView); make.right.equalTo(weakSelf.contentView); make.bottom.equalTo(weakSelf.contentView); make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale); }]; } #pragma mark - Property - (UILabel *)tipLabel { if (!_tipLabel) { _tipLabel = [[UILabel alloc] init]; _tipLabel.textColor = UIColorFromRGB(0x7a7a7a); _tipLabel.font = [UIFont systemFontOfSize:16.0]; } return _tipLabel; } - (UIPlaceHolderTextView *)textView { if (!_textView) { _textView = [[UIPlaceHolderTextView alloc] init]; _textView.font = [UIFont systemFontOfSize:16.0]; _textView.placeholderColor = UIColorFromRGB(0x999999); _textView.scrollEnabled = NO; } return _textView; } - (UIImageView*)arrowIcon { if (!_arrowIcon) { _arrowIcon = [[UIImageView alloc] init]; _arrowIcon.image = [UIImage imageNamed:@"Alpha3_more_icon"]; } return _arrowIcon; } - (UIView*)makeNewLine { UIView *line = [[UIView alloc] init]; line.backgroundColor = UIColorFromRGB(0xcccccc); return line; } @end