WaterMarkTableViewCell.swift 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. //
  2. // WaterMarkTableViewCell.swift
  3. // O2Platform
  4. //
  5. // Created by FancyLou on 2022/3/30.
  6. // Copyright © 2022 zoneland. All rights reserved.
  7. //
  8. import UIKit
  9. class WaterMarkTableViewCell: UITableViewCell {
  10. override func awakeFromNib() {
  11. super.awakeFromNib()
  12. // Initialization code
  13. }
  14. override func setSelected(_ selected: Bool, animated: Bool) {
  15. super.setSelected(selected, animated: animated)
  16. }
  17. var myLabel: UILabel? = nil
  18. func setText(text: String) {
  19. self.backgroundColor = .clear
  20. if self.myLabel == nil {
  21. self.myLabel = UILabel(frame: CGRect(x: 0, y: 0, width: SCREEN_HEIGHT*3, height: CGFloat(WaterMarkView.lineHeight)))
  22. self.contentView.addSubview(self.myLabel!)
  23. self.myLabel?.textColor = .black
  24. self.myLabel?.font = UIFont(name: "PingFangSC-Regular", size: 18.0)
  25. self.myLabel?.alpha = 0.2
  26. self.myLabel?.backgroundColor = .clear
  27. }
  28. self.myLabel?.text = text
  29. }
  30. }