LNIMChatUnknownMessageCell.swift 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // LNIMChatUnknownMessageCell.swift
  3. // Lanu
  4. //
  5. // Created by OneeChan on 2025/12/8.
  6. //
  7. import Foundation
  8. import UIKit
  9. import SnapKit
  10. class LNIMChatUnknownMessageCell: UITableViewCell {
  11. private let contentLabel = UILabel()
  12. override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  13. super.init(style: style, reuseIdentifier: reuseIdentifier)
  14. setupViews()
  15. }
  16. required init?(coder: NSCoder) {
  17. fatalError("init(coder:) has not been implemented")
  18. }
  19. }
  20. extension LNIMChatUnknownMessageCell {
  21. private func setupViews() {
  22. backgroundColor = .clear
  23. let container = UIView()
  24. container.backgroundColor = .fill
  25. container.layer.cornerRadius = 11
  26. contentView.addSubview(container)
  27. container.snp.makeConstraints { make in
  28. make.top.equalToSuperview().offset(2)
  29. make.centerX.equalToSuperview()
  30. make.leading.greaterThanOrEqualToSuperview().offset(20)
  31. make.bottom.equalToSuperview().offset(-10)
  32. }
  33. contentLabel.text = .init(key: "A00077")
  34. contentLabel.font = .body_xs
  35. contentLabel.textColor = .text_3
  36. container.addSubview(contentLabel)
  37. contentLabel.snp.makeConstraints { make in
  38. make.verticalEdges.equalToSuperview().inset(4)
  39. make.horizontalEdges.equalToSuperview().inset(8)
  40. }
  41. }
  42. }