Blame view

HDFwear/Mine/LaunchViewController.swift 1.83 KB
f2cf74c7   yangbin   1.0.20(4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
  //
  //  LaunchViewController.swift
  //  Twear
  //
  //  Created by yangbin on 2021/12/29.
  //
  
  import UIKit
  
  class LaunchViewController: UIViewController {
  
      override func viewDidLoad() {
          super.viewDidLoad()
          view.backgroundColor = .white
          
          let imageView = UIImageView(frame: view.frame)
          imageView.image = UIImage(named: "launch_image")
          imageView.contentMode = .scaleAspectFit
          view.addSubview(imageView)
a25b5a83   daifengyi   feat:launch view UI
20
21
22
23
24
25
26
27
28
29
  //        let size = LocString("立即体验").boundingRect(with: CGSize(width: 300, height: 30), options: .usesLineFragmentOrigin, attributes: [.font: RegularFont(15)], context: nil).size
  //        let width = size.width+28
          var bottomSpace = 0.0
          if #available(iOS 11.0, *) {
              let window = UIApplication.shared.windows[0]
              let bottomPadding = window.safeAreaInsets.bottom
              bottomSpace = bottomPadding
          }
          let button = UIButton(frame: CGRect(x: SCREEN_WIDTH/2-184/2, y: SCREEN_HEIGHT-(80 + bottomSpace), width: 184, height: 52))
          button.setColor(radio: 26, color: .rgbColorFromHex(0x24C789), borderColor: .clear, textColor: .white, text: LocString("立即体验"))
f2cf74c7   yangbin   1.0.20(4)
30
          button.addTarget(self, action: #selector(gotoHomeVC), for: .touchUpInside)
a25b5a83   daifengyi   feat:launch view UI
31
          button.titleLabel?.font = RegularFont(18)
f2cf74c7   yangbin   1.0.20(4)
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
          view.addSubview(button)
      }
      
      @objc private func gotoHomeVC() {
          KeyWindow.rootViewController = ZCTabBarController()
          KeyWindow.makeKeyAndVisible()
      }
      
      /*
      // MARK: - Navigation
  
      // In a storyboard-based application, you will often want to do a little preparation before navigation
      override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
          // Get the new view controller using segue.destination.
          // Pass the selected object to the new view controller.
      }
      */
  
  }