[英]Xcode 7 & Swift - Static UITableView with TextField not editable
你试过了吗:
YourTextField.userInteractionEnabled = true
并以编程方式设置占位符文本?
如果您将它放在我假设使用的单元格中:
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell
{
var cell = tableView.dequeueReusableCellWithIdentifier(indexPath.row, forIndexPath: indexPath) as! UITableViewCell
cell.YourTextField.placeholder = "Your placeholder text"
return cell
}
更正:
您的约束可能是将文本视图移动到单元格的可见部分之外。
我会尝试删除您的约束并重新运行程序。
这是 github 项目的链接https://github.com/Rnorback/statictablewithfields
干杯!
对我来说,在我覆盖 tableview 提交编辑委托功能之前,这些单元格是不可编辑的。
func tableView(
_ tableView: UITableView,
commit editingStyle: UITableViewCell.EditingStyle,
forRowAt indexPath: IndexPath) {
}
考虑到它什么都不返回,有点违反直觉。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.