具有动态原型内容和多部分的 UITableView
UITableView with dynamic prototypes content and multi sections
在 xCode 6.1.1 界面生成器中,当我选择 "dynamic prototypes" 类型的 UITableView 内容时,我无法 select 拥有多个部分,任何线索如何拥有table 包含多个部分和动态原型?
无法在界面生成器中找到实现它的方法,但我已经通过为 UITableView 内容选择 "dynamic prototypes" 解决了这个问题,然后在 UITableViewController 中添加了这个:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return N // number of required sections
}
现在我可以在有多个部分时获得我的原型细胞:
let cell = tableView.dequeueReusableCellWithIdentifier("cellIdentifier") as UITableViewCell
希望这对其他人也有帮助。
在 xCode 6.1.1 界面生成器中,当我选择 "dynamic prototypes" 类型的 UITableView 内容时,我无法 select 拥有多个部分,任何线索如何拥有table 包含多个部分和动态原型?
无法在界面生成器中找到实现它的方法,但我已经通过为 UITableView 内容选择 "dynamic prototypes" 解决了这个问题,然后在 UITableViewController 中添加了这个:
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
return N // number of required sections
}
现在我可以在有多个部分时获得我的原型细胞:
let cell = tableView.dequeueReusableCellWithIdentifier("cellIdentifier") as UITableViewCell
希望这对其他人也有帮助。