cha*_*ura 3 uitableview uiviewcontroller ios swift
我正在使用UITableViewController静态单元格并添加了UILabel和文本框.我甚至添加了约束.但是当我运行程序时,单元格是空的.
这是我的截图:
我刚刚发现
override func viewWillAppear(animated: Bool) {
self.navigationController?.setToolbarHidden(false, animated: true)
}
override func viewWillDisappear(animated: Bool) {
self.navigationController?.setToolbarHidden(true, animated: true)
}
Run Code Online (Sandbox Code Playgroud)
上面的代码让它消失了
Nai*_*hta 11
在Swift 2中,针对该问题测试了以下修复
'注释'下面的子类UITableViewController时出现的自动生成/样板代码(因为你使用静态单元格,它们可能不会被使用)
override func numberOfSectionsInTableView(tableView: UITableView) -> Int {
// #warning Incomplete implementation, return the number of sections
return 0
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
// #warning Incomplete implementation, return the number of rows
return 0
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4543 次 |
| 最近记录: |