RQAboutViewController.m 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // RQAboutViewController.m
  3. // jiaPei
  4. //
  5. // Created by 张嵘 on 2022/9/16.
  6. // Copyright © 2022 JCZ. All rights reserved.
  7. //
  8. #import "RQAboutViewController.h"
  9. @interface RQAboutViewController ()
  10. /// viewModel
  11. @property (nonatomic, readonly, strong) RQAboutViewModel *viewModel;
  12. @end
  13. @implementation RQAboutViewController
  14. @dynamic viewModel;
  15. - (void)viewDidLoad {
  16. [super viewDidLoad];
  17. /// 设置子控件
  18. [self setupSubViews];
  19. }
  20. #pragma mark - Override
  21. - (UIEdgeInsets)contentInset{
  22. return UIEdgeInsetsMake(RQ_APPLICATION_NAV_BAR_HEIGHT + RQ_APPLICATION_STATUS_BAR_HEIGHT, 0, 0, 0);
  23. }
  24. #pragma mark - 设置子控件
  25. - (void)setupSubViews{
  26. @weakify(self);
  27. /// 设置header
  28. self.tableView.tableHeaderView = [RQAboutUsHeaderView rq_viewFromXib];
  29. self.tableView.tableHeaderView.rq_height = 250;
  30. /// 添加富文本
  31. YYLabel *copyrightLabel = [[YYLabel alloc] init];
  32. copyrightLabel.numberOfLines = 0;
  33. copyrightLabel.textAlignment = NSTextAlignmentCenter;
  34. NSMutableAttributedString *attributedText = [[NSMutableAttributedString alloc] initWithString:@"极速驾培 版权所有\nCopyright©2022 All Rights Reserved"];
  35. attributedText.yy_font = RQRegularFont_14;
  36. attributedText.yy_color = RQ_MAIN_TEXT_COLOR_2;
  37. attributedText.yy_alignment = NSTextAlignmentCenter;
  38. copyrightLabel.attributedText = attributedText.copy;
  39. /// 设置高度
  40. YYTextContainer *container = [YYTextContainer containerWithSize:CGSizeMake(RQ_SCREEN_WIDTH, MAXFLOAT)];
  41. YYTextLayout *layout = [YYTextLayout layoutWithContainer:container text:attributedText];
  42. copyrightLabel.rq_y = RQ_SCREEN_HEIGHT - layout.textBoundingSize.height - RQ_APPLICATION_NAV_BAR_HEIGHT - RQ_APPLICATION_STATUS_BAR_HEIGHT - 13;
  43. copyrightLabel.rq_width = RQ_SCREEN_WIDTH ;
  44. copyrightLabel.rq_height = layout.textBoundingSize.height;
  45. [self.tableView addSubview:copyrightLabel];
  46. }
  47. @end