123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172 |
- //
- // SubmitInputCellTableViewCell.m
- // FirstLink
- //
- // Created by jack on 15/6/18.
- // Copyright (c) 2015年 FirstLink. All rights reserved.
- // 文本输入的cell
- #import "SubmitInputCell.h"
- @implementation SubmitInputCell
- @synthesize titleLabel = _titleLabel;
- @synthesize inputField = _inputField;
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
- {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- [self initialize];
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- }
- return self;
- }
- - (void)initialize{
-
- [self.contentView addSubview:self.titleLabel];
- [self.contentView addSubview:self.inputField];
-
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.contentView).offset(15);
- make.centerY.equalTo(self.contentView);
- }];
-
- [self.inputField mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.titleLabel.mas_right).offset(10);
- make.right.equalTo(self.contentView).offset(- 15);
- make.height.equalTo(self.contentView);
- make.centerY.equalTo(self.contentView);
- }];
- }
- - (void)fk_configWithViewModel:(FKSubmitOrderViewModel *)viewModel indexPath:(NSIndexPath *)indexPath{
- if ([viewModel isKindOfClass:[FKSubmitOrderViewModel class]]) {
- self.titleLabel.text = @"备注 :";
- self.inputField.placeholder = @"可以在这里补充说明哦";
- }
- }
- - (UITextField *)inputField{
- if (_inputField == nil) {
- _inputField = [[UITextField alloc]init];
- _inputField.textColor = UIColorFromRGB(0x333333);
- _inputField.font = [UIFont systemFontOfSize:14];
- _inputField.textAlignment = NSTextAlignmentLeft;
- _inputField.returnKeyType = UIReturnKeyDone;
- }
- return _inputField;
- }
- - (UILabel *)titleLabel{
- if (_titleLabel == nil) {
- _titleLabel = [[UILabel alloc]init];
- _titleLabel.backgroundColor = [UIColor clearColor];
- _titleLabel.font = [UIFont systemFontOfSize:14];
- _titleLabel.textColor = UIColorFromRGB(0x333333);
- [_titleLabel setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
- }
- return _titleLabel;
- }
- @end
|