-
Notifications
You must be signed in to change notification settings - Fork 1.3k
/
Copy pathAddCommentCell.m
51 lines (47 loc) · 1.59 KB
/
AddCommentCell.m
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
//
// AddCommentCell.m
// Coding_iOS
//
// Created by Ease on 15/6/3.
// Copyright (c) 2015年 Coding. All rights reserved.
//
#import "AddCommentCell.h"
@interface AddCommentCell ()
@property (strong, nonatomic) UIImageView *iconView;
@property (strong, nonatomic) UILabel *contentL;
@end
@implementation AddCommentCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
// Initialization code
self.backgroundColor = kColorTableBG;
if (!_iconView) {
_iconView = [UIImageView new];
_iconView.image = [UIImage imageNamed:@"icon_add_comment"];
[self.contentView addSubview:_iconView];
}
if (!_contentL) {
_contentL = [UILabel new];
_contentL.font = [UIFont systemFontOfSize:14];
_contentL.textColor = kColorDark7;
_contentL.text = @"添加评论";
[self.contentView addSubview:_contentL];
}
[_iconView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(22, 22));
make.centerY.equalTo(self.contentView);
make.centerX.equalTo(self.contentView).offset(-50);
}];
[_contentL mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(_iconView.mas_right).offset(15);
make.centerY.equalTo(self.contentView);
make.height.mas_equalTo(20);
}];
}
return self;
}
+ (CGFloat)cellHeight{
return 44.0;
}
@end