BFThumImageView.swift 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // BFThumImageView.swift
  3. // BFRecordScreenKit
  4. //
  5. // Created by 胡志强 on 2022/2/9.
  6. //
  7. import Foundation
  8. class BFThumImageView: UIImageView {
  9. var isHiddenBord = false{
  10. didSet{
  11. if let v = self.viewWithTag(12333){
  12. v.isHidden = isHiddenBord
  13. }
  14. }
  15. }
  16. override init(frame: CGRect) {
  17. super.init(frame: frame)
  18. addIndicationView()
  19. }
  20. required init?(coder: NSCoder) {
  21. fatalError("init(coder:) has not been implemented")
  22. }
  23. override init(image: UIImage?) {
  24. super.init(image: image)
  25. addIndicationView()
  26. }
  27. func addIndicationView(){
  28. let bottomView = UIView()
  29. bottomView.backgroundColor = ThemeStyleColor
  30. addSubview(bottomView)
  31. bottomView.snp.makeConstraints { make in
  32. make.left.bottom.width.equalToSuperview()
  33. make.height.equalTo(6)
  34. }
  35. let line = UIView()
  36. line.backgroundColor = .black
  37. line.tag = 12333
  38. addSubview(line)
  39. line.snp.makeConstraints { make in
  40. make.right.top.bottom.equalToSuperview()
  41. make.width.equalTo(1)
  42. }
  43. }
  44. }