我想弄清楚为什么我的活动指示器没有显示在我的视图控制器上,这是我的代码如下 var activityIN : UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0,0, 50, 50)) as UIActivityIndicatorView acti
var activityIN : UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(0,0, 50, 50)) as UIActivityIndicatorView activityIN.center = self.view.center activityIN.hidesWhenStopped = true activityIN.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray activityIN.startAnimating()试试这个,看看你遗忘的最后一行
var activityIN : UIActivityIndicatorView = UIActivityIndicatorView(frame: CGRectMake(100 ,200, 50, 50)) as UIActivityIndicatorView activityIN.center = self.view.center activityIN.hidesWhenStopped = true activityIN.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray activityIN.startAnimating() self.view.addSubview(activityIN)