NYFailItemPointCellView01.m 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //
  2. // NYFailItemPointCellView01.m
  3. // jiaPei
  4. //
  5. // Created by Ning.ge on 2024/12/17.
  6. // Copyright © 2024 JCZ. All rights reserved.
  7. //
  8. #import "NYFailItemPointCellView01.h"
  9. @implementation NYFailItemPointCellView01
  10. - (instancetype)initWithFrame:(CGRect)frame {
  11. if (self = [super initWithFrame:frame]) {
  12. self.layer.cornerRadius = 5;
  13. self.layer.masksToBounds = YES;
  14. CGFloat topbarH = 40;
  15. UIView *topbar_view = [[UIView alloc] initWithFrame:CGRectMake(0, 0, frame.size.width, topbarH)];
  16. topbar_view.backgroundColor = UIColorHex(0xC1D7FF);
  17. [self addSubview:topbar_view];
  18. self.topbar_view = topbar_view;
  19. CGFloat contentH = frame.size.height - topbarH;
  20. UIView *content_view = [[UIView alloc] initWithFrame:CGRectMake(0, topbarH, frame.size.width, contentH)];
  21. [self addSubview:content_view];
  22. self.content_view = content_view;
  23. UILabel *topbar_label = [[UILabel alloc] initWithFrame:topbar_view.bounds];
  24. topbar_label.textAlignment = NSTextAlignmentCenter;
  25. topbar_label.font = [UIFont boldSystemFontOfSize:15.f];
  26. topbar_label.textColor = UIColorHex(0x173CA7);
  27. topbar_label.text = @"考试常识";
  28. [topbar_view addSubview:topbar_label];
  29. self.topbar_label = topbar_label;
  30. }
  31. return self;
  32. }
  33. - (void)layoutSubviews{
  34. [super layoutSubviews];
  35. }
  36. @end