单军华
2018-03-29 89d748b77b478905732e60f0b4c5807c274b6565
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
//
//  GloriaButton.m
//  AiShangTaiCangTuan
//
//  Created by Gloria on 15-1-10.
//  Copyright (c) 2015年 gloria. All rights reserved.
//
 
#import "GloriaButton.h"
#import "GloriaLabel.h"
 
@implementation GloriaButton
 
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/
 
-(instancetype)initWithFrame:(CGRect)frame withTitle:(NSString *)title
{
    if (self = [super initWithFrame:frame]) {
        self = [GloriaButton buttonWithType:UIButtonTypeCustom];
        self.frame = frame;
 
//        UIImageView *imageView = [[UIImageView alloc] initWithFrame:frame];
//        imageView.image = [UIImage imageNamed:@"add_cart_normal"];
//        [self addSubview:imageView];
        
        self.backgroundColor = NAVIGATIONTINTCOLOR;
        
        [self setTitle:title forState:UIControlStateNormal];
        
//        GloriaLabel *textLabel = [[GloriaLabel alloc] initWithFrame:frame];
//        textLabel.text = title;
//        textLabel.textColor = [UIColor redColor];
//        textLabel.textAlignment = NSTextAlignmentCenter;
//        [self addSubview:textLabel];
    }
    return self;
}
 
@end