我尝试在UITableView
中按照Apple指南进行多项选择。我所做的基本上只是:
tableView.allowsMultipleSelectionDuringEditing = true
然后:
tableView.setEditing(true, animated: true)
下面: https://developer.apple.com/library/ios/samplecode/TableMultiSelect/Introduction/Intro.html
在他们的示例应用中,UITableViewCell
中的标签在进入编辑模式时会向右挤压一点。
但是,在我的应用中,默认复选框覆盖了复选框。
我应该做些什么来获得正确的行为?
答案 0 :(得分:2)
而不是在单元格上添加子视图(标签)
//cell.addSubview(aLabel)
在单元格的contentView上添加标签
cell.contentView.addSubview(aLabel)