MaskCell.m 1.81 KB
Newer Older
陈俊俊's avatar
陈俊俊 committed
1 2 3 4 5 6 7 8 9 10 11
//
//  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
陈俊俊's avatar
陈俊俊 committed
12
#define TableHeight 45
陈俊俊's avatar
陈俊俊 committed
13 14 15 16
#define BtnSize 14
@implementation MaskCell


n22's avatar
n22 committed
17
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier totalWidth:(CGFloat)totalWidth totalHeight:(CGFloat)totalHeight{
陈俊俊's avatar
陈俊俊 committed
18 19 20 21
    
    self =  [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.totalWidth = totalWidth;
n22's avatar
n22 committed
22
        self.totalHeight = totalHeight;
陈俊俊's avatar
陈俊俊 committed
23 24 25 26 27 28 29
        [self bulidLayout];
    }
    return self;
}

- (void)bulidLayout
{    
n22's avatar
n22 committed
30
    self.titleLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, 0, self.totalWidth - LeftMargin - BtnSize, self.totalHeight))];
陈俊俊's avatar
陈俊俊 committed
31 32 33 34 35 36
    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];
    
n22's avatar
n22 committed
37
    self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.totalHeight-1, self.totalWidth - LeftMargin * 2, 1))];
陈俊俊's avatar
陈俊俊 committed
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
    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