SBTEmptyView.swift 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. //
  2. // SBTEmptyView.swift
  3. // SolarBT
  4. //
  5. // Created by weclouds on 2019/1/25.
  6. // Copyright © 2019 weclouds. All rights reserved.
  7. //
  8. import UIKit
  9. class SBTEmptyView: UIView {
  10. @IBOutlet weak var messageLabel: UILabel!
  11. @IBOutlet weak var addButton: UIButton!
  12. var buttonStr : String?
  13. var messageStr :String?
  14. override func awakeFromNib() {
  15. super.awakeFromNib()
  16. addButton.layer.masksToBounds = true
  17. self.addButton.layer.cornerRadius = 20
  18. //fillCode
  19. let bgLayer1 = CAGradientLayer()
  20. bgLayer1.colors = [UIColor(red: 1, green: 0.52, blue: 0.07, alpha: 1).cgColor, UIColor(red: 1, green: 0.67, blue: 0, alpha: 1).cgColor]
  21. bgLayer1.locations = [0,1]
  22. bgLayer1.frame = addButton.bounds
  23. bgLayer1.startPoint = CGPoint(x: 1, y: 1)
  24. bgLayer1.endPoint = CGPoint(x: 0, y: 0)
  25. // addButton.layer.addSublayer(bgLayer1)
  26. // LocalizationManager.shareInstance().callback = {
  27. // self.addButton.setTitle("Add_it_now".da_localizedStr(), for: .normal)
  28. // self.messageLabel.text = "No_devices_are_currently_added".da_localizedStr()
  29. // }
  30. }
  31. func reloadView() {
  32. self.addButton.setTitle(self.buttonStr, for: .normal)
  33. self.messageLabel.text = self.messageStr
  34. }
  35. }