【发布时间】:2015-05-27 18:19:05
【问题描述】:
我有一个TableView,我已经为该TableView 创建了带有图像、标签..等的自定义单元格,但我希望一个单元格与其他单元格不同,它有自己的内容(单元格将从后端)。
那么如何在同一个TableView 中创建两种不同类型的单元格,以及如何排列它们,例如将一种类型的单元格放在另外两个之间?
编辑:我的 UITableView 类:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let myCell: CellTableViewCell = tableView.dequeueReusableCellWithIdentifier("myCell", forIndexPath: indexPath) as! CellTableViewCell
let otherCell: OtherCellTableViewCell = tableView.dequeueReusableCellWithIdentifier("otherCell", forIndexPath: indexPath) as! OtherCellTableViewCell
// Configure the cell...
return myCell
}
【问题讨论】:
标签: xcode uitableview custom-cell