| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // TableDefaultCell.m
- // model
- //
- // Created by JuYi on 2018/7/16.
- // Copyright © 2018年 Mine. All rights reserved.
- // 标题 + 内容 cell
- #import "TableDefaultCell.h"
- @implementation TableDefaultCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
- if (self) {
- self.selectionStyle = UITableViewCellSelectionStyleNone;
- self.backgroundColor = [UIColor whiteColor];
- [self setUpSubViewsForCell];
- }
- return self;
- }
- - (void)setUpSubViewsForCell {
- CGFloat cellHeight = 50;
- UILabel *titleLabel = [[UILabel alloc] init];
- titleLabel.frame = CGRectMake(20, 0, 80, cellHeight);
- titleLabel.textAlignment = NSTextAlignmentLeft;
- titleLabel.font = [UIFont systemFontOfSize:16];
- titleLabel.textColor = RGBValueColor(0x333333, 1.0);
- [self.contentView addSubview:titleLabel];
- self.titleLabel = titleLabel;
- //
- UITextField *contentTF = [[UITextField alloc] init];
- contentTF.frame = CGRectMake(CGRectGetMaxX(titleLabel.frame), 0, ScreenWidth - 121, cellHeight);
- contentTF.textAlignment = NSTextAlignmentLeft;
- contentTF.font = [UIFont systemFontOfSize:16];
- contentTF.textColor = RGBValueColor(0x333333, 1.0);
- [contentTF setValue:RGBValueColor(0x999999, 1.0) forKeyPath:@"_placeholderLabel.textColor"];
- contentTF.clearButtonMode = UITextFieldViewModeWhileEditing;
- [self.contentView addSubview:contentTF];
- self.contentTF = contentTF;
- //
- self.lineView = [[UIImageView alloc] initWithFrame:CGRectMake(0, cellHeight - 1, ScreenWidth, 1)];
- self.lineView.image = [UIImage imageNamed:@"fengexian"];
- [self.contentView addSubview:self.lineView];
-
- }
- @end
|