FooterCell.m 1.46 KB
Newer Older
n22's avatar
n22 committed
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
//
//  FooterCell.m
//  XFFruit
//
//  Created by n22 on 15/8/19.
//  Copyright (c) 2015年 Xummer. All rights reserved.
//

#import "FooterCell.h"
#define HeadWidth 70
#define LeftMargin 13
@interface FooterCell ()
@property (nonatomic,strong)NSString *title;
@property (nonatomic,strong)UILabel *lineLabel;

@end
@implementation FooterCell
- (instancetype)initWithFrame:(CGRect)frame withTitle:(NSString *)title{
    self = [super initWithFrame:frame];
    if (self) {
        self.title = title;
        [self bulidLayout];
    }
    return self;
}
- (void)bulidLayout{
    
    UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
    addBtn.frame = CGRectMake(0, 0, self.frame.size.width, 50);
    [addBtn setTitle:self.title forState:UIControlStateNormal];
    addBtn.backgroundColor = [UIColor whiteColor];
陈俊俊's avatar
陈俊俊 committed
32
    [addBtn setTitleColor:GXF_PLACEHOLDER_COLOR forState:UIControlStateNormal];
n22's avatar
n22 committed
33
    [addBtn addTarget:self action:@selector(addBtn) forControlEvents:UIControlEventTouchUpInside];
陈俊俊's avatar
陈俊俊 committed
34
     addBtn.titleLabel.font = GXF_FIFTEENTEN_SIZE;
n22's avatar
n22 committed
35 36
    [self addSubview:addBtn];
    self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(LeftMargin, self.frame.size.height-1, ScreenSize.width - LeftMargin * 2, 1))];
陈俊俊's avatar
陈俊俊 committed
37 38
    self.lineLabel.backgroundColor = GXF_LINE_COLOR;
    self.lineLabel.font = GXF_FIFTEENTEN_SIZE;
n22's avatar
n22 committed
39 40 41 42 43 44 45 46 47 48 49
    [self addSubview:self.lineLabel];
}

- (void)addBtn{
    if ([self.delegate respondsToSelector:@selector(addClick)]) {
        [self.delegate addClick];
    }
}


@end