【发布时间】:2015-07-09 14:11:43
【问题描述】:
我有一些文本进入我在表格视图单元格中创建的 UIlabels。当这些表格视图单元格更新时,文本会自行重叠,几乎就像之前的文本一样没有被删除,如下所示:
代码:
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("Cell",forIndexPath: indexPath) as! UITableViewCell
var nameLabel = UILabel(frame: CGRectMake(cell.frame.size.width * 0.040, cell.frame.size.height * 0.22, cell.frame.size.width * 0.735, cell.frame.size.height * 0.312))
var userAtIndexPath = finalMatchesBlurUser[indexPath.row]
nameLabel.text = userAtIndexPath.username.uppercaseString
cell.addSubview(nameLabel)
}
finalMatchesBlurUser 是从 Parses 数据库中获取的一个 PFUser,它将发生变化,而这种变化是导致名称重叠的原因。
谁能指出为什么会这样?
【问题讨论】:
标签: swift uitableview parse-platform