11 uitableview multipleselection ios swift
我想问一下,当我点击右上角的按钮"选择"时,我可以转发到编辑模式,我可以选择多行,例如在消息应用中,当您可以通过点击圆圈选择多个消息时.
像这样:
我搜索了很多,真的,但找不到任何东西.谁能帮我?一些建议
Leo*_*Leo 44
组
tableView.allowsMultipleSelectionDuringEditing = true
Run Code Online (Sandbox Code Playgroud)
截图

演示代码
class TableviewController:UITableViewController{
override func viewDidLoad() {
super.viewDidLoad()
tableView.allowsMultipleSelectionDuringEditing = true
tableView.setEditing(true, animated: false)
}
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCellWithIdentifier("cell", forIndexPath: indexPath)
cell.textLabel?.text = "\(indexPath.row)"
return cell
}
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return 10
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
17437 次 |
| 最近记录: |