0
我是swift的新手我有一個問題,那就是當滾動表格視圖時,滾動表格視圖單元格中的單元格時發抖或發抖。任何一個可以告訴我在IOS模擬器不能實時設備。我的問題測試的原因。我就是爲什麼它是在模擬器在Swift中滾動表格視圖時,原型單元格發抖或發抖
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("transportCell") as! UITableViewCell
cell.textLabel?.text = transportItems[indexPath.row]
var imageName = UIImage(named: transportItems[indexPath.row])
cell.imageView?.image = imageName
return cell
}
我不確定是什麼問題,但我會做一點不同。對我而言,表視圖不負責對象實例化,只是顯示對象。所以我會找到一種方法在顯示Table View之前將我的對象組裝成一個數組。這樣當你的tableView被加載時,它的工作量就會減少。 –
準確地說,我也會建議。 – pbush25