QuoteDetailController.m 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. //
  2. // QuoteDetailController.m
  3. // AIIM
  4. //
  5. // Created by qitewei on 2025/5/29.
  6. //
  7. #import "QuoteDetailController.h"
  8. @interface QuoteDetailController ()
  9. @property (nonatomic, strong) UIScrollView *scrollView;
  10. @property (nonatomic, strong) UIView *contentView;
  11. @property (nonatomic, strong) UILabel *quoteContentLabel;
  12. @end
  13. @implementation QuoteDetailController
  14. - (void)viewDidLoad {
  15. [super viewDidLoad];
  16. [self configUI];
  17. [self configConstraints];
  18. [self populateData];
  19. }
  20. - (void)configUI{
  21. // self.view.backgroundColor = UIColor.whiteColor;
  22. UIImageView * bgImageView = [[UIImageView alloc] initWithImage:kImageMake(@"loginBG")];
  23. [self.view addSubview:bgImageView];
  24. [bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
  25. make.left.right.top.bottom.mas_equalTo(0);
  26. }];
  27. [self setNavigationTitle:self.quotedSenderName];
  28. [self setNavigationBarTransparent:YES];
  29. [self setNavigationBarBackgroundColor:UIColor.clearColor];
  30. [self setNavigationTitleColor:UIColor.whiteColor font:SYSBFONT(18)];
  31. [self addBarButtonWithImage:kImageMake(@"fanhui") position:BarButtonItemPositionLeft action:@selector(backToChat)];
  32. self.view.backgroundColor = UIColor.blackColor;
  33. // [self setNavigationTitle:self.quotedSenderName];
  34. // // 设置导航栏背景色
  35. // [self setNavigationBarBackgroundColor:UIColor.clearColor];
  36. //
  37. // // 设置标题颜色和字体
  38. // [self setNavigationTitleColor:[UIColor whiteColor] font:[UIFont boldSystemFontOfSize:16]];
  39. //
  40. // // 设置返回按钮
  41. // [self setBackButtonTitle:@"fanhui"];
  42. // [self setBackButtonColor:[UIColor whiteColor]];
  43. _scrollView = [[UIScrollView alloc] init];
  44. [self.view addSubview:_scrollView];
  45. // 内容视图
  46. _contentView = [[UIView alloc] init];
  47. [_scrollView addSubview:_contentView];
  48. _quoteContentLabel = [[UILabel alloc] init];
  49. _quoteContentLabel.textColor = UIColor.whiteColor;
  50. _quoteContentLabel.numberOfLines = 0;
  51. _quoteContentLabel.font = SYSMFONT(24);
  52. [_contentView addSubview:_quoteContentLabel];
  53. // [self.view jk_addTapActionWithBlock:^(UIGestureRecognizer *gestureRecoginzer) {
  54. // [self dismissViewControllerAnimated:YES completion:nil];
  55. // }];
  56. }
  57. #pragma mark private
  58. - (void)backToChat{
  59. [self dismissViewControllerAnimated:YES completion:nil];
  60. }
  61. - (void)configConstraints{
  62. [_scrollView mas_makeConstraints:^(MASConstraintMaker *make) {
  63. make.edges.equalTo(self.view);
  64. }];
  65. [_contentView mas_makeConstraints:^(MASConstraintMaker *make) {
  66. make.edges.equalTo(_scrollView);
  67. make.width.equalTo(_scrollView);
  68. }];
  69. [_quoteContentLabel mas_makeConstraints:^(MASConstraintMaker *make) {
  70. make.top.equalTo(_contentView.mas_top).offset(112);
  71. make.left.equalTo(_contentView).offset(12);
  72. make.right.equalTo(_contentView).offset(-12);
  73. make.bottom.equalTo(_contentView).offset(-12);
  74. }];
  75. }
  76. - (void)populateData{
  77. NSString *quoteText;
  78. if (self.quotedSenderName) {
  79. quoteText = [NSString stringWithFormat:@"%@: %@", self.quotedSenderName, self.quotedContent];
  80. }else{
  81. quoteText = self.quotedContent;
  82. }
  83. _quoteContentLabel.text = quoteText;
  84. }
  85. @end