线上所有马甲包模板,与《猎豆》同UI。域名zhuadd

HSQSectionAllGoodView.m 2.6KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. //
  2. // HSQSectionAllGoodView.m
  3. // YouHuiProject
  4. //
  5. // Created by liuxueli on 2018/12/14.
  6. // Copyright © 2018 kuxuan. All rights reserved.
  7. //
  8. #import "HSQSectionAllGoodView.h"
  9. @implementation HSQSectionAllGoodView
  10. -(instancetype)initWithFrame:(CGRect)frame
  11. {
  12. self =[super initWithFrame:frame];
  13. if (self) {
  14. self.backgroundColor =[UIColor backgroudColor];
  15. UIView *views =[[UIView alloc]init];
  16. views.backgroundColor =[UIColor whiteColor];
  17. UIImageView *leftimg =[[UIImageView alloc]init];
  18. leftimg.image =[UIImage imageNamed:@"search_left"];
  19. UILabel *label =[[UILabel alloc]init];
  20. label.text=@"全网商品";
  21. label.textColor=[UIColor colorWithRGB:0x3B3B3B];
  22. [label setFont:[UIFont fontWithName:@"Helvetica-Bold" size:FITSIZE(16)]];
  23. UIImageView *rightimg =[[UIImageView alloc]init];
  24. rightimg.image =[UIImage imageNamed:@"search_right"];
  25. UIImageView *lineV =[[UIImageView alloc]init];
  26. lineV.backgroundColor =[UIColor backgroudColor];
  27. [self addSubview:views];
  28. [self addSubview:leftimg];
  29. [self addSubview:label];
  30. [self addSubview:rightimg];
  31. [self addSubview:lineV];
  32. [views mas_makeConstraints:^(MASConstraintMaker *make) {
  33. make.top.mas_equalTo(FITSIZE(10));
  34. make.width.mas_equalTo(self.mas_width);
  35. make.height.mas_equalTo(self.mas_height).offset(-FITSIZE(10));
  36. }];
  37. [label mas_makeConstraints:^(MASConstraintMaker *make) {
  38. make.centerX.mas_equalTo(views.mas_centerX);
  39. make.centerY.mas_equalTo(views.mas_centerY);
  40. make.width.mas_equalTo(FITSIZE(70));
  41. }];
  42. [leftimg mas_makeConstraints:^(MASConstraintMaker *make) {
  43. make.right.mas_equalTo(label.mas_left).offset(FITSIZE(-10));
  44. make.width.mas_equalTo(FITSIZE(13));
  45. make.height.mas_equalTo(FITSIZE(7));
  46. make.centerY.mas_equalTo(views.mas_centerY);
  47. }];
  48. [rightimg mas_makeConstraints:^(MASConstraintMaker *make) {
  49. make.right.mas_equalTo(label.mas_right).offset(FITSIZE(15));
  50. make.width.mas_equalTo(FITSIZE(13));
  51. make.height.mas_equalTo(FITSIZE(7));
  52. make.centerY.mas_equalTo(views.mas_centerY);
  53. }];
  54. [lineV mas_makeConstraints:^(MASConstraintMaker *make) {
  55. make.width.mas_equalTo(views.mas_width);
  56. make.height.mas_equalTo(1);
  57. make.top.mas_equalTo(views.mas_bottom).offset(-1);
  58. }];
  59. }
  60. return self;
  61. }
  62. @end