MaskCell.m 1.79 KB
Newer Older
陈俊俊's avatar
陈俊俊 committed
1 2 3 4 5 6 7 8 9 10
//
//  MaskCell.m
//  XFFurit
//
//  Created by 陈俊俊 on 15/8/1.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "MaskCell.h"
#define LeftMargin 20
陈俊俊's avatar
陈俊俊 committed
11
#define TableHeight 45
陈俊俊's avatar
陈俊俊 committed
12 13 14 15
#define BtnSize 14
@implementation MaskCell


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

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