Art*_*rti 5 uitableview ios uiaccessoryview swift
override func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let key = keyArray[indexPath.section-1]
let label = UILabel(frame: CGRectMake(0, 0, 26, 28))
label.center = CGPointMake(26, 28)
cell.accessoryView = label
}
override func tableView(tableView: UITableView, accessoryButtonTappedForRowWithIndexPath indexPath: NSIndexPath) {
print(indexPath)
}
Run Code Online (Sandbox Code Playgroud)
为什么不调用自定义标签或自定义按钮accessoryButtonTappedForRowWithIndexPath.或者只有一种方法将myButton添加到单元格?
| 归档时间: |
|
| 查看次数: |
747 次 |
| 最近记录: |