import UIKit
class ViewController: UIViewController {
var activityIndicator:UIActivityIndicatorView!
override func viewDidLoad() {
super.viewDidLoad()
activityIndicator = UIActivityIndicatorView(activityIndicatorStyle:
UIActivityIndicatorViewStyle.Gray)
activityIndicator.center=self.view.center
self.view.addSubview(activityIndicator);
play()
}
func play(){
//进度条开始转动
activityIndicator.startAnimating()
}
func stop(){
//进度条停止转动
activityIndicator.stopAnimating()
}
}
- 设置本界面不可点击,但是导航栏除外
self.view.isUserInteractionEnabled = false