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
//
// MaskCell.m
// XFFurit
//
// Created by 陈俊俊 on 15/8/1.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "MaskCell.h"
#define TitleSize 14
#define LeftMargin 20
#define TableHeight 45
#define BtnSize 14
@implementation MaskCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier totalWidth:(CGFloat)totalWidth totalHeight:(CGFloat)totalHeight{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
self.totalWidth = totalWidth;
self.totalHeight = totalHeight;
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, self.totalWidth - LeftMargin - BtnSize, self.totalHeight))];
self.titleLabel.textAlignment= NSTextAlignmentLeft;
self.titleLabel.textColor = HexColor(@"666666");
self.titleLabel.font = FontSize(TitleSize);
self.Commitbtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(self.totalWidth- LeftMargin - BtnSize, 10, BtnSize, BtnSize) target:nil sel:nil tag:0 image:@"selected" title:nil titleColor:nil isCorner:NO corner:0 bgColor:nil];
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.totalHeight-1, self.totalWidth - LeftMargin * 2, 1))];
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
self.lineLabel.font = FontSize(TitleSize);
[self.contentView addSubview:self.titleLabel];
[self.contentView addSubview:self.lineLabel];
[self.contentView addSubview:self.Commitbtn];
}
- (void)setTitleStr:(NSString *)str
{
self.titleLabel.text = str;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end