12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- //
- // FKVipBuyGuideButton.m
- // FirstLink
- //
- // Created by ascii on 2017/5/25.
- // Copyright © 2017年 FirstLink. All rights reserved.
- //
- #import "FKVipBuyGuideButton.h"
- @interface FKVipBuyGuideButton ()
- @property (nonatomic, strong) UIImageView *imgView;
- @property (nonatomic, strong) UILabel *vipLabel;
- @end
- @implementation FKVipBuyGuideButton
- /*
- // 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 {
- self = [super initWithFrame:frame];
-
- [self addSubview:self.imgView];
- [self.imgView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self).offset(6);
- make.centerY.equalTo(self);
- make.size.mas_equalTo(CGSizeMake(12, 12));
- }];
-
- [self addSubview:self.vipLabel];
- [self.vipLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.equalTo(self.imgView.mas_right).offset(5);
- make.centerY.equalTo(self).offset(-2);
- }];
-
- UIView *line = [UIView new];
- line.backgroundColor = UIColorFromRGB(0xff6362);
- [self addSubview:line];
- [line mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.right.equalTo(self.vipLabel);
- make.top.equalTo(self.vipLabel.mas_bottom).offset(2);
- make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
- }];
-
- return self;
- }
- #pragma mark - Property
- - (UIImageView *)imgView{
- if (_imgView == nil) {
- _imgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"CouponQuestionIcon"]];
- }
- return _imgView;
- }
- - (UILabel *)vipLabel {
- if (_vipLabel == nil) {
- _vipLabel = [[UILabel alloc]init];
- _vipLabel.textColor = UIColorFromRGB(0xff6362);
- _vipLabel.font = [UIFont boldSystemFontOfSize:9];
- _vipLabel.text = @"购买VIP";
- }
- return _vipLabel;
- }
- @end
|