.rowHeight
我在调整.toDoListTable
. 从 a 接收的字符串UITextfield
在每行的末尾被切断。我在设置原型单元格时没有添加标签,因为我的字符串是从 UITextField
. 我的代码如下:
override func viewDidLoad() {
super.viewDidLoad()
toDoListTable.estimatedRowHeight = 45.0
toDoListTable.rowHeight = UITableViewAutomaticDimension
}
}
然而,我的文字仍然被截断。有什么建议么?另外,我的代码在正确的位置吗?
我希望我的内容适应从UITextField
.
编辑:通过添加解决问题cell.textLabel?.numberOfLines = 0
。