我正在快速做一个 iOS 8 自定义键盘,并且我在视图中添加了一个 UIActivityIndicatorView,问题是我可以看到它,但不能旋转,它是静态的,这是代码:
@IBOutlet var menuLabel: UILabel!
override func viewDidLoad() {
super.viewDidLoad()
self.load_indicator = UIActivityIndicatorView(frame: CGRectMake(0,0, 50, 50)) as UIActivityIndicatorView
self.load_indicator.hidesWhenStopped = true
self.load_indicator.activityIndicatorViewStyle = UIActivityIndicatorViewStyle.Gray
self.view.addSubview(self.load_indicator)
}
override func viewDidAppear(animated: Bool) {
super.viewDidAppear(animated)
dispatch_async(dispatch_get_main_queue(), {
self.load_indicator.startAnimating()
})
}
加载指示器出现,但它是静态的,我该怎么办?