QSLPopViewCell.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // QSLPopViewCell.swift
  3. // QuickSearchLocation
  4. //
  5. // Created by Destiny on 2024/12/4.
  6. //
  7. import UIKit
  8. class QSLPopViewCell: UITableViewCell {
  9. let iconImageView: UIImageView = {
  10. let imageView = UIImageView()
  11. imageView.contentMode = .scaleAspectFit
  12. return imageView
  13. }()
  14. let titleLabel: UILabel = {
  15. let label = UILabel()
  16. label.font = UIFont.systemFont(ofSize: 14)
  17. label.textColor = .black
  18. return label
  19. }()
  20. override init(style: UITableViewCell.CellStyle, reuseIdentifier: String?) {
  21. super.init(style: style, reuseIdentifier: reuseIdentifier)
  22. // contentView.addSubview(iconImageView)
  23. contentView.addSubview(titleLabel)
  24. titleLabel.snp.makeConstraints { make in
  25. make.center.equalToSuperview()
  26. }
  27. }
  28. required init?(coder: NSCoder) {
  29. fatalError("init(coder:) has not been implemented")
  30. }
  31. override func layoutSubviews() {
  32. super.layoutSubviews()
  33. // let imageSize: CGFloat = 24
  34. // iconImageView.frame = CGRect(x: 15, y: (contentView.frame.height - imageSize) / 2, width: imageSize, height: imageSize)
  35. // titleLabel.frame = CGRect(x: iconImageView.frame.maxX + 10, y: 0, width: contentView.frame.width - iconImageView.frame.maxX - 25, height: contentView.frame.height)
  36. }
  37. }