省钱达人

DRDetailHeaderTitle.m 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. //
  2. // DRDetailHeaderTitle.m
  3. // YouHuiProject
  4. //
  5. // Created by 小花 on 2018/7/10.
  6. // Copyright © 2018年 kuxuan. All rights reserved.
  7. //
  8. #import "DRDetailHeaderTitle.h"
  9. @implementation DRDetailHeaderTitle
  10. - (instancetype)initWithFrame:(CGRect)frame title:(NSString *)text color:(UIColor *)color{
  11. self = [super initWithFrame:frame];
  12. if (self) {
  13. self.backgroundColor = [UIColor whiteColor];
  14. UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.width, self.height)];
  15. title.font = [UIFont systemFontOfSize:Fitsize(15)];
  16. title.textColor = color;
  17. title.centerX = self.width/2;
  18. title.textAlignment = NSTextAlignmentCenter;
  19. title.text = text;
  20. [self addSubview:title];
  21. // UIView *leftLine = [[UIView alloc] initWithFrame:CGRectMake(title.left-60, 0, 50, 1)];
  22. // leftLine.backgroundColor = [UIColor YHColorWithHex:0x666666];
  23. // leftLine.centerY = self.height/2;
  24. // [self addSubview:leftLine];
  25. //
  26. // UIView *rightLine = [[UIView alloc] initWithFrame:CGRectMake(title.right+10, 0, 50, 1)];
  27. // rightLine.backgroundColor = [UIColor YHColorWithHex:0x666666];
  28. // rightLine.centerY = self.height/2;
  29. // [self addSubview:rightLine];
  30. }
  31. return self;
  32. }
  33. @end