12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485 |
- //
- // FKBasketWeightView.m
- // FirstLink
- //
- // Created by jack on 16/6/16.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "FKBasketPriceView.h"
- @interface FKBasketPriceView ()
- @property (nonatomic, strong) UIView *containerView;
- //@property (nonatomic, strong) UIImageView *iconImgView;
- @end
- @implementation FKBasketPriceView
- - (instancetype)init {
- if (self = [super init]) {
- [self addAllSubviews];
- }
- return self;
- }
- - (void)addAllSubviews {
- UIView *topLine = [[UIView alloc]init];
- topLine.backgroundColor = UIColorFromRGB(0xe5e5e5);
-
- [self addSubview:self.containerView];
- [self.containerView mas_makeConstraints:^(MASConstraintMaker *make) {
- make.edges.equalTo(self);
- }];
-
- [self.containerView addSubview:self.postageLabel];
- [self.postageLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.containerView).offset(- 15);
- make.centerY.equalTo(self.containerView);
- }];
-
- [self.containerView addSubview:self.weightLabel];
- [self.weightLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.right.equalTo(self.postageLabel.mas_left).offset(- 20);
- make.centerY.equalTo(self.containerView);
- }];
-
- [self.containerView addSubview:topLine];
- [topLine mas_makeConstraints:^(MASConstraintMaker *make) {
- make.left.top.right.equalTo(self.containerView);
- make.height.mas_equalTo(1.0/[UIScreen mainScreen].scale);
- }];
- }
- + (CGFloat)weightViewHeight {
- return 55;
- }
- - (UILabel *)weightLabel {
- if (_weightLabel == nil) {
- _weightLabel = [[UILabel alloc] init];
- _weightLabel.font = [UIFont systemFontOfSize:13];
- _weightLabel.textColor = UIColorFromRGB(0x666666);
- }
- return _weightLabel;
- }
- - (UILabel *)postageLabel {
- if (_postageLabel == nil) {
- _postageLabel = [[UILabel alloc] init];
- _postageLabel.font = [UIFont systemFontOfSize:13];
- _postageLabel.textColor = UIColorFromRGB(0x666666);
- }
- return _postageLabel;
- }
- - (UIView *)containerView {
- if (_containerView == nil) {
- _containerView = [[UIView alloc] init];
- _containerView.backgroundColor = [UIColor whiteColor];
- }
- return _containerView;
- }
- @end
|