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
//
// GMImageTitleLabelButton.m
// Gengmei
//
// Created by wangyang on 15/10/15.
// Copyright © 2015年 Wanmeichuangyi. All rights reserved.
//
#import "GMVerticalLayoutButton.h"
#import "GMFont.h"
#import <Masonry/Masonry.h>
#import <UIColor+GMTheme.h>
@implementation GMVerticalLayoutButton
- (void)setup{
[super setup];
_buttonLabel = [UILabel new];
_buttonLabel.font = [UIFont gmFont:10];
_buttonLabel.textColor = UIColor.bodyText;
[self addSubview:_buttonLabel];
_buttonImageView = [UIImageView new];
[self addSubview:_buttonImageView];
[self setBackgroundColor:RGBCOLOR_HEX(0xfafafa) forState:UIControlStateHighlighted];
[self setBackgroundColor:UIColor.whiteColor forState:UIControlStateNormal];
}
- (void)updateConstraints{
[self.buttonLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
make.bottom.mas_equalTo(-10);
make.centerX.mas_equalTo(0);
}];
[self.buttonImageView mas_remakeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(10);
make.centerX.mas_equalTo(0);
}];
[super updateConstraints];
}
@end