如何在ios程序开发中正确使用activity indicator
1个回答
展开全部
class ViewController: UIViewController {
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBAction func clickButton(_ sender: UIButton) {
imageView.image = nil
activityIndicator.startAnimating()
sleep(5)
activityIndicator.stopAnimating()
imageView.image = UIImage(named: "cat")
}
}
@IBOutlet weak var imageView: UIImageView!
@IBOutlet weak var activityIndicator: UIActivityIndicatorView!
@IBAction func clickButton(_ sender: UIButton) {
imageView.image = nil
activityIndicator.startAnimating()
sleep(5)
activityIndicator.stopAnimating()
imageView.image = UIImage(named: "cat")
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询