【发布时间】:2017-07-18 10:51:39
【问题描述】:
是否可以一次只选择 UITableview 的两个单元格?目前我只能设置 UITableView 的单选或多选。
请任何人都可以为此在 Swift3 中发布想法或代码?
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("MyIdentifier") as! UITableViewCell
let currentItem = data[indexPath.row]
if currentItem.selected {
cell.imageView!.image = UIImage(named:"check")!
cell.textLabel!.font = UIFont(name:"OpenSans-Bold", size:15)
} else {
cell.imageView!.image = nil
cell.textLabel!.font = UIFont(name:"OpenSans-Regular", size:15)
}
return cell
}
【问题讨论】:
标签: ios uitableview swift3 xcode8