我想添加 2 个单元格,一个作为前一个表格 View 的标题,第二个单元格用于详细信息,例如这个原型(prototype)。
第一个 Cell 类“courseCell” 第二单元类“DetailsTVC”
找了很多方法都行不通,希望有人帮忙
I couldn't follow with this instruction Initialize your custom tableviewcell - CustomCell1 and CustomCell2 Since tableviewcell is a subclass of UIView you can add it as a subview.
[TableCell addSubview:CustomCell1];
[TableCell addSubview:CustomCell2];
cell?.addSubview(<#view: UIView>)
[cell ?.addSubview(<#view: UIView>)]
override func tableView(tableView: UITableView!, cellForRowAtIndexPath indexPath: NSIndexPath!, object: PFObject!) -> PFTableViewCell {
var cell = tableView.dequeueReusableCellWithIdentifier("cell" , forIndexPath : indexPath) as? courseCell
if cell == nil
{
cell = courseCell(style: UITableViewCellStyle.Default, reuseIdentifier: "cell")
}
cell?.name.text = object["title"] as! String!
cell?.location.text = object["Location"] as! String!
return cell!
}
最佳答案
完成它:
TableViewController
- Tableview
- TableViewHeader (create a UIView subclass for this view)
- TableViewContent (datasource)
- TableViewCell1 (virgin american fligth ...)
- TableViewCell1 (departs los angeles)
- TableViewCell1 (arrives new york)
请注意,您的 tableviewController 不需要 XIB 文件
关于ios - 如何在表格 View 中添加三个表格 View 单元格作为 subview ?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29216184/