// // DRDetailHeaderTitle.m // YouHuiProject // // Created by 小花 on 2018/7/10. // Copyright © 2018年 kuxuan. All rights reserved. // #import "DRDetailHeaderTitle.h" @implementation DRDetailHeaderTitle - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)text color:(UIColor *)color{ self = [super initWithFrame:frame]; if (self) { self.backgroundColor = [UIColor whiteColor]; UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)]; title.font = [UIFont systemFontOfSize:Fitsize(15)]; title.textColor = color; title.centerX = self.width/2; title.textAlignment = NSTextAlignmentCenter; title.text = text; [self addSubview:title]; // UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(title.left-60, 0, 50, 1)]; // leftLine.backgroundColor = [UIColor YHColorWithHex:0x666666]; // leftLine.centerY = self.height/2; // [self addSubview:leftLine]; // // UIView *rightLine = [[UIView alloc] initWithFrame:CGRectMake(title.right+10, 0, 50, 1)]; // rightLine.backgroundColor = [UIColor YHColorWithHex:0x666666]; // rightLine.centerY = self.height/2; // [self addSubview:rightLine]; } return self; } @end