Basic use of iOS-UIActivityIndicatorView (system loading)

insert image description here

   lazy var indicatorView:UIActivityIndicatorView = {
    
    
        let tempview = UIActivityIndicatorView.init(style:.large)
        tempview.frame = CGRect.init(x: 200, y: 200, width: 100, height: 100)
        tempview.color = .white
        tempview.backgroundColor = .black
        return tempview
    }()
 override func viewDidLoad() {
    
    
        super.viewDidLoad()
        view.backgroundColor = .brown
        view.addSubview(indicatorView)
        indicatorView.startAnimating()//旋转动画
   }
  indicatorView.stopAnimating() //停止旋转
        
  indicatorView.hidesWhenStopped =  true //停止旋转的时候 隐藏
         
   indicatorView.isAnimating //是否在炫转

Guess you like

Origin blog.csdn.net/weixin_43259805/article/details/123225292