// // OrderPayBottomView.m // FirstLink // // Created by jack on 15/7/9. // Copyright (c) 2015年 FirstLink. All rights reserved. // #import "OrderPayBottomView.h" @implementation OrderPayBottomView{ UILabel *_tipLabel; } @synthesize amountLabel = _amountLabel; @synthesize payButton = _payButton; - (instancetype)initWithFrame:(CGRect)frame { if (self = [super initWithFrame:frame]) { [self initializeLayout]; } return self; } - (void)initializeLayout { self.backgroundColor = UIColorFromRGB(0xffffff); _tipLabel = ({ UILabel *label = [[UILabel alloc]init]; label.font = [UIFont systemFontOfSize:14]; label.textColor = UIColorFromRGB(0x333333); label.text = @"支付总额:"; label; }); [self addSubview:_tipLabel]; [self addSubview:self.amountLabel]; [self addSubview:self.payButton]; [_tipLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(self).offset(15); make.centerY.equalTo(self); }]; [self.amountLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(_tipLabel.mas_right).offset(5); make.centerY.equalTo(self); }]; [self.payButton mas_makeConstraints:^(MASConstraintMaker *make) { make.top.right.bottom.equalTo(self); make.width.equalTo(@105); }]; } - (UILabel *)amountLabel { if (_amountLabel == nil) { _amountLabel = [[UILabel alloc]init]; _amountLabel.font = [UIFont systemFontOfSize:14]; _amountLabel.textColor = UIColorFromRGB(0xf85a5a); } return _amountLabel; } - (UIButton *)payButton { if (_payButton == nil) { _payButton = [UIButton buttonWithType:UIButtonTypeCustom]; [_payButton setTitle:@"立即付款" forState:UIControlStateNormal]; [_payButton setTitleColor:UIColorFromRGB(0xffffff) forState:UIControlStateNormal]; [_payButton setBackgroundColor:UIColorFromRGB(0xff6362)]; _payButton.titleLabel.font = [UIFont systemFontOfSize:14]; } return _payButton; } @end