标签:
Swift中,除了条形进度条外,还有环形进度条,效果图如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
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() } override func didReceiveMemoryWarning() { super .didReceiveMemoryWarning() } } |
Swift - 环形进度条(UIActivityIndicatorView)的用法
标签:
原文地址:http://www.cnblogs.com/Free-Thinker/p/4838645.html