VerButton.m 771 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // VerButton.m
  3. // MingMen
  4. //
  5. // Created by 罗云飞 on 2017/3/9.
  6. // Copyright © 2017年 罗云飞. All rights reserved.
  7. //
  8. #import "VerButton.h"
  9. @implementation VerButton
  10. - (id)initWithFrame:(CGRect)frame
  11. {
  12. self = [super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor = [UIColor whiteColor];
  15. self.titleLabel.textAlignment = NSTextAlignmentCenter;
  16. _lineView = [[UIView alloc] init];
  17. _lineView.backgroundColor = [UIColor colorWithRed:0.81f green:0.81f blue:0.81f alpha:1.00f];
  18. [self addSubview:_lineView];
  19. }
  20. return self;
  21. }
  22. - (void)layoutSubviews
  23. {
  24. [super layoutSubviews];
  25. _lineView.frame = CGRectMake(0, self.bounds.size.height-0.5, self.bounds.size.width, 0.5);
  26. }
  27. @end