// // JiageCell.m // jitao // // Created by 罗云飞 on 2018/1/22. // Copyright © 2018年 罗云飞. All rights reserved. // #import "JiageCell.h" @implementation JiageCell - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{ self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; if (self) { _title = [UILabel new]; _title.font = NewFont(fitScreenWidth(12)); _title.text = @"价格"; [_title setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:_title]; _title.sd_layout .leftSpaceToView(self.contentView, 15) .heightIs(fitScreenWidth(44)) .topSpaceToView(self.contentView, 10); _negotiableBT = [UIButton new]; [_negotiableBT setTitle:@"面议" forState:UIControlStateNormal]; [_negotiableBT setTitleColor:NewButtonColor forState:UIControlStateNormal]; [_negotiableBT setBackgroundColor:NewWhiteColor]; ViewBorderRadius(_negotiableBT, 10, .6, NewButtonColor); _negotiableBT.titleLabel.font = NewFont(fitScreenWidth(12)); [self.contentView addSubview:_negotiableBT]; _negotiableBT.sd_layout .leftSpaceToView(self.contentView, 60) .heightIs(30) .widthIs(80) .centerYEqualToView(_title); UILabel *label = [UILabel new]; label.text = @"万元"; label.textColor = [UIColor colorWithString:@"#A1A1A1"]; label.font = NewFont(fitScreenWidth(12)); [label setSingleLineAutoResizeWithMaxWidth:0]; [self.contentView addSubview:label]; label.sd_layout .rightSpaceToView(self.contentView, 15) .centerYEqualToView(_title) .heightIs(fitScreenWidth(44)); _view = [UIView new]; _view.backgroundColor = NewLineGrayColor; [self.contentView addSubview:_view]; ViewRadius(_view, 5); _view.sd_layout .leftSpaceToView(_negotiableBT, 20) .rightSpaceToView(label, 5) .bottomSpaceToView(self.contentView, 5) .topSpaceToView(self.contentView, 10); _textfield = [NewControlPackage textFieldInitWithFrame:CGRectMake(0, 0, 0, 0) backgroundImage:nil backgroundColor:NewLineGrayColor textColor:NewGrayColor placeholder:@"请输入价格" hidden:NO tag:100 font:NewFont(fitScreenWidth(12)) textAlignment:NSTextAlignmentLeft clearButtonMode:UITextFieldViewModeNever clearsOnBeginEditing:NO adjustsFontSizeToFitWidth:NO secureTextEntry:NO keyboardType:UIKeyboardTypeNumberPad returnKeyType:UIReturnKeyDefault userInteractionEnabled:YES]; [_view addSubview:_textfield]; _textfield.sd_layout .leftSpaceToView(_view, 15) .topEqualToView(_view) .bottomEqualToView(_view) .rightEqualToView(_view); } return self; } - (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