Geen omschrijving

FKSexChoseBtn.m 1.5KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. //
  2. // FKSexChoseView.m
  3. // FirstLink
  4. //
  5. // Created by jack on 16/4/26.
  6. // Copyright © 2016年 FirstLink. All rights reserved.
  7. //
  8. #import "FKSexChoseBtn.h"
  9. @interface FKSexChoseBtn ()
  10. @property (nonatomic, strong) UIImageView *arrowImgView;
  11. @end
  12. @implementation FKSexChoseBtn
  13. - (instancetype)initWithFrame:(CGRect)frame{
  14. if (self = [super initWithFrame:frame]) {
  15. [self addAllSubviews];
  16. }
  17. return self;
  18. }
  19. - (instancetype)initWithSexTitle:(NSString *)title{
  20. if (self = [super init]) {
  21. self.titleLabel.text = title;
  22. }
  23. return self;
  24. }
  25. - (void)addAllSubviews{
  26. self.backgroundColor = [UIColorFromRGB(0xff6362) colorWithAlphaComponent:0.5];
  27. [self addSubview:self.arrowImgView];
  28. [self addSubview:self.titleLabel];
  29. [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  30. make.centerY.equalTo(self);
  31. make.left.equalTo(self).offset(15);
  32. }];
  33. [self.arrowImgView mas_makeConstraints:^(MASConstraintMaker *make) {
  34. make.right.equalTo(self).offset(- 15);
  35. make.centerY.equalTo(self);
  36. }];
  37. }
  38. - (UILabel *)titleLabel{
  39. if (_titleLabel == nil) {
  40. _titleLabel = [[UILabel alloc]init];
  41. _titleLabel.textColor = UIColorFromRGB(0xffffff);
  42. _titleLabel.font = [UIFont systemFontOfSize:17];
  43. }
  44. return _titleLabel;
  45. }
  46. - (UIImageView *)arrowImgView{
  47. if (_arrowImgView == nil) {
  48. _arrowImgView = [[UIImageView alloc]initWithImage:[UIImage imageNamed:@"guideRightArrow"]];
  49. }
  50. return _arrowImgView;
  51. }
  52. @end