// // PindanDetailself.m // FirstLink // // Created by jack on 15/6/28. // Copyright (c) 2015年 FirstLink. All rights reserved. // #import "PindanDetailHeaderView.h" @implementation PindanDetailHeaderView - (instancetype)initWithFrame:(CGRect)frame { self = [super initWithFrame:frame]; if (self) { [self initializeLayout]; } return self; } - (void)initializeLayout { UIView *leftLine = [[UIView alloc]init]; UIView *rightLine = [[UIView alloc]init]; self.backgroundColor = [UIColor whiteColor]; leftLine.backgroundColor = UIColorFromRGB(0xe5e5e5); rightLine.backgroundColor = UIColorFromRGB(0xe5e5e5); UILabel *titleLabel = ({ UILabel *label = [[UILabel alloc]init]; label.backgroundColor = [UIColor clearColor]; label.text = @"商品详情"; label.textColor = UIColorFromRGB(0x333333); label.font = [UIFont systemFontOfSize:14]; label; }); [self addSubview:leftLine]; [self addSubview:rightLine]; [self addSubview:titleLabel]; [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) { make.center.equalTo(self); }]; [leftLine mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.equalTo(self); make.right.equalTo(titleLabel.mas_left).offset(- 8); make.height.equalTo(@0.5); make.width.equalTo(@110); }]; [rightLine mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(titleLabel.mas_right).offset(8); make.centerY.equalTo(self); make.width.equalTo(@110); make.height.equalTo(@0.5); }]; } @end