No Description

KXQuestionButton.m 1.7KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. //
  2. // KXQuestionButton.m
  3. // QBCS
  4. //
  5. // Created by kuxuan on 2017/6/9.
  6. // Copyright © 2017年 kuxuan. All rights reserved.
  7. //
  8. #import "KXQuestionButton.h"
  9. @implementation KXQuestionButton
  10. -(instancetype)initWithFrame:(CGRect)frame
  11. {
  12. if (self==[super initWithFrame:frame]) {
  13. self.backgroundColor=[UIColor whiteColor];
  14. [self setupUI];
  15. }
  16. return self;
  17. }
  18. -(void)setupUI
  19. {
  20. self.nameLabel=[[UILabel alloc]initWithFrame:CGRectMake(14, 20, SCREEN_WIDTH-40, 15)];
  21. self.nameLabel.textColor=[UIColor titleColor];
  22. self.nameLabel.font=[UIFont systemFontOfSize:15];
  23. self.nameLabel.numberOfLines=0;
  24. self.nameLabel.preferredMaxLayoutWidth=SCREEN_WIDTH-70;
  25. [self addSubview:self.nameLabel];
  26. [self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  27. make.centerY.mas_equalTo(self);
  28. make.left.mas_equalTo(self).offset(20*SCREEN_MUTI);
  29. }];
  30. self.imageView=[[UIImageView alloc]initWithFrame:CGRectMake(SCREEN_WIDTH-30, 20, 10, 15)];
  31. [self addSubview:self.imageView];
  32. [self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.centerY.mas_equalTo(self);
  34. make.right.mas_equalTo(self).offset(-20*SCREEN_MUTI);
  35. }];
  36. UIView *line = [[UIView alloc] init];
  37. line.backgroundColor = [UIColor KXColorWithHex:0xe9e9e9];
  38. [self addSubview:line];
  39. [line mas_makeConstraints:^(MASConstraintMaker *make) {
  40. make.left.mas_equalTo(self).offset(15*SCREEN_MUTI);
  41. make.right.mas_equalTo(self).offset(-15*SCREEN_MUTI);
  42. make.bottom.mas_equalTo(self);
  43. make.height.mas_equalTo(@1);
  44. }];
  45. }
  46. -(void)setImageInpage
  47. {
  48. UIImageView *inpage=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@""]];
  49. NSLog(@"%@",inpage);
  50. }
  51. @end