Ios 如何将标签文本添加到DetailDispositionButton?
我在iOS Swift 2.0应用程序中工作。我一辈子都不知道如何在披露指示器V形符号之前设置Ios 如何将标签文本添加到DetailDispositionButton?,ios,swift,uitableview,accessoryview,Ios,Swift,Uitableview,Accessoryview,我在iOS Swift 2.0应用程序中工作。我一辈子都不知道如何在披露指示器V形符号之前设置UITableViewCell右侧的文本(除了创建自定义单元格.accessoryView) 下面是“设置应用程序”的截图,它正是我想要实现的 在Interface Builder中,设置单元格时,选择正确的详图样式: 然后将该值指定给detailTextLabel属性: cell.detailTextLabel.text = "Kilroy Was Here" 您可以使用自定义单元格来实现它。 o
UITableViewCell
右侧的文本(除了创建自定义单元格.accessoryView
)
下面是“设置应用程序”的截图,它正是我想要实现的
在Interface Builder中,设置单元格时,选择正确的详图样式: 然后将该值指定给
detailTextLabel
属性:
cell.detailTextLabel.text = "Kilroy Was Here"
您可以使用自定义单元格来实现它。
override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "CellId") ?? UITableViewCell(style: UITableViewCellStyle.value1, reuseIdentifier: "CellId")
cell.accessoryType = UITableViewCellAccessoryType.disclosureIndicator
cell.textLabel?.text = "Main text"
cell.detailTextLabel?.text = "Detail Text"
return cell
}