1234567891011121314151617181920212223242526272829303132333435363738394041 |
- //
- // LDDetailHeaderTitle.m
- // YouHuiProject
- //
- // Created by 小花 on 2018/7/10.
- // Copyright © 2018年 kuxuan. All rights reserved.
- //
- #import "LDDetailHeaderTitle.h"
- @implementation LDDetailHeaderTitle
- - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)text{
- self = [super initWithFrame:frame];
- if (self) {
- self.backgroundColor = [UIColor whiteColor];
- UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, Fitsize(65), self.height)];
- title.font = [UIFont systemFontOfSize:Fitsize(14)];
- title.textColor = [UIColor YHColorWithHex:0x666666];
- 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
|