// // PYCellInputView.m // Food // // Created by ko1o on 2019/7/25. // Copyright © 2019年 ko1o. All rights reserved. // #import "PYCellInputView.h" @implementation PYCellInputView + (PYCellInputView *)cellInputViewWithTitle:(NSString *)title titleWidth:(CGFloat)titleWidth placeholder:(NSString *)placeholder { PYCellInputView *inputView = [[PYCellInputView alloc] init]; inputView.width = SCREEN_WIDTH; inputView.height = 50.0; inputView.backgroundColor = UIColor.whiteColor; UILabel *titleLabel = [[UILabel alloc] init]; titleLabel.font = MT_FONT_REGULAR_SIZE(14); titleLabel.textColor = TITLE_COLOR; titleLabel.height = inputView.height; titleLabel.x = 15.0; titleLabel.width = titleWidth; titleLabel.text = title; inputView.titleLabel = titleLabel; [inputView addSubview:titleLabel]; UITextField *textField = [[UITextField alloc] init]; textField.placeholder = placeholder; textField.font = MT_FONT_MEDIUM_SIZE(15); textField.textColor = TITLE_COLOR; textField.x = titleLabel.right; textField.height = inputView.height; textField.width = inputView.width - textField.x - titleLabel.x; textField.clearButtonMode = UITextFieldViewModeWhileEditing; [inputView addSubview:textField]; inputView.texfField = textField; UIView *lineView = [[UIView alloc] init]; lineView.width = inputView.width; lineView.height = 0.7; lineView.backgroundColor = COLOR_WITH_RGB(0xeeeeee); lineView.bottom = inputView.height; inputView.bottomLineView = lineView; [inputView addSubview:lineView]; return inputView; } @end