forked from coding/Coding-iOS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEditLabelHeadCell.m
More file actions
57 lines (50 loc) · 1.89 KB
/
EditLabelHeadCell.m
File metadata and controls
57 lines (50 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// EditLabelHeadCell.m
// Coding_iOS
//
// Created by zwm on 15/4/16.
// Copyright (c) 2015年 Coding. All rights reserved.
//
#import "EditLabelHeadCell.h"
@interface EditLabelHeadCell ()
@end
@implementation EditLabelHeadCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.accessoryType = UITableViewCellAccessoryNone;
self.backgroundColor = kColorTableBG;
// Initialization code
if (!_labelField) {
_labelField = [[UITextField alloc] initWithFrame:CGRectMake(kPaddingLeftWidth, 0, (kScreen_Width - kPaddingLeftWidth * 2 - 50), 44)];
_labelField.textColor = [UIColor colorWithHexString:@"0x222222"];
_labelField.font = [UIFont systemFontOfSize:16];
_labelField.placeholder = @"输入新标签的名称";
//_labelField.
[self.contentView addSubview:_labelField];
}
if (!_addBtn) {
_addBtn = [[UIButton alloc] initWithFrame:CGRectMake(kScreen_Width - kPaddingLeftWidth - 50, 7, 50, 30)];
_addBtn.layer.cornerRadius = 4;
_addBtn.layer.borderWidth = 0.6;
_addBtn.layer.borderColor = [UIColor colorWithHexString:@"0xdddddd"].CGColor;
[_addBtn setTitle:@"添加" forState:UIControlStateNormal];
[_addBtn.titleLabel setFont:[UIFont systemFontOfSize:16]];
[_addBtn setTitleColor:[UIColor colorWithHexString:@"0x3bbd79"] forState:UIControlStateNormal];
[_addBtn setTitleColor:[UIColor colorWithHexString:@"0xdddddd"] forState:UIControlStateDisabled];
_addBtn.enabled = FALSE;
[self.contentView addSubview:_addBtn];
}
}
return self;
}
- (void)layoutSubviews
{
[super layoutSubviews];
}
+ (CGFloat)cellHeight
{
return 44.0;
}
@end