0
我有一個表視圖控制器和I在屏幕的中viewDidLoad中的中心()UIActivityIndicatorView未出現後滾動的UITableView
let bounds = UIScreen.mainScreen().bounds;
let width = bounds.size.width
let height = bounds.size.height
loadingIndicator = UIActivityIndicatorView(frame: CGRectMake(width/2, height/2, 75, 75))
loadingIndicator.layer.cornerRadius = 10
loadingIndicator.backgroundColor = kfbBlue
loadingIndicator.center = CGPointMake(width/2, height/2 - 37)
loadingIndicator.activityIndicatorViewStyle = .WhiteLarge
loadingIndicator.hidesWhenStopped = true
self.tableView.addSubview(loadingIndicator)
loadingIndicator.startAnimating()
這只是正常顯示UIActivityIndicatorView。我有一個重載表格視圖數據的重載方法。 reload()工作,但如果在滾動表視圖後按下調用此方法的按鈕,則不會顯示活動指示符。它只會在表格視圖向上滾動時出現。
func reload() {
loadingIndicator.startAnimating()
self.beginParsing()
}
無論桌面視圖滾動多遠,我怎樣才能讓活動指示符出現在中心?
我試過了,它的確問題是一樣的。 – raginggoat
你的'UIViewController'是'UITableViewController',意思是self.view與self.tableView相同? – wottle
這是一個UITableViewController – raginggoat