123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263 |
- //
- // LogisticsQuestionCell.m
- // FirstLink
- //
- // Created by ascii on 16/1/14.
- // Copyright © 2016年 FirstLink. All rights reserved.
- //
- #import "LogisticsQuestionCell.h"
- @interface LogisticsQuestionCell ()
- @property (nonatomic, strong) UILabel *titleLabel;
- @end
- @implementation LogisticsQuestionCell
- - (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- self = [super initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:reuseIdentifier];
- if (self) {
- [self addAllSubViews];
- }
- return self;
- }
- - (void)addAllSubViews {
- [self.contentView addSubview:self.iconButton];
- [self.iconButton mas_makeConstraints:^(MASConstraintMaker *make) {
- make.centerX.equalTo(self.contentView);
- make.top.equalTo(self.contentView).with.offset(120);
- }];
-
- [self.contentView addSubview:self.titleLabel];
- [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
- make.top.equalTo(self.iconButton.mas_bottom).offset(7);
- make.centerX.equalTo(self.contentView);
- }];
- }
- #pragma mark - Property
- - (UIButton *)iconButton {
- if (!_iconButton) {
- _iconButton = [UIButton buttonWithType:UIButtonTypeCustom];
- [_iconButton setBackgroundImage:[UIImage imageNamed:@"LogisticsQuestionIcon"] forState:UIControlStateNormal];
- }
- return _iconButton;
- }
- - (UILabel *)titleLabel {
- if (!_titleLabel) {
- _titleLabel = [UILabel new];
- _titleLabel.font = [UIFont systemFontOfSize:14];
- _titleLabel.textAlignment = NSTextAlignmentCenter;
- _titleLabel.textColor = UIColorFromRGB(0xcccccc);
- _titleLabel.text = @"物流说明";
- }
- return _titleLabel;
- }
- @end
|