Ios 如何在UITableView单元格中设置已启用的用户交互
我正在使用Ios 如何在UITableView单元格中设置已启用的用户交互,ios,uitableview,Ios,Uitableview,我正在使用UITableview(分组)。我已禁用xib中的用户交互。但是,我想为一个单元格启用交互。如何启用此功能?我使用了[cell setUserInteractionEnabled:yes],但它不起作用-未调用tableView didselectrowindexpath。谁能给我推荐一下吗。提前感谢在Xib中启用用户交互。 加 在 希望能有帮助。快乐编码:)在Xib中启用用户交互。 加 在 希望能有帮助。快乐编码:) 希望这对你有帮助 希望,这将帮助您//要启用或禁用特定单元格中的用
UITableview
(分组)。我已禁用xib中的用户交互。但是,我想为一个单元格启用交互。如何启用此功能?我使用了[cell setUserInteractionEnabled:yes]
,但它不起作用<代码>-未调用tableView didselectrowindexpath。谁能给我推荐一下吗。提前感谢在Xib中启用用户交互。
加
在
希望能有帮助。快乐编码:)在Xib中启用用户交互。 加 在 希望能有帮助。快乐编码:) 希望这对你有帮助
希望,这将帮助您//要启用或禁用特定单元格中的用户交互,您可以尝试以下代码 func tableView(tableView:UITableView,cellForRowAt indexath:indexPath)->UITableViewCell{ //我已经使用guard Station创建了类的对象,如果您愿意,也可以使用它
guard let createCell = tableView.dequeueReusableCell(withIdentifier: "Create") as? CreateProfileCell else {
return CreateProfileCell()
}
//现在你们可以在你们想要的单元中启用或禁用用户交互,就像我在下面做的一样
切换到xpath.row{
case 0:
createCell.isUserInteractionEnabled = false . // false to disable interaction
case 1:
createCell.isUserInteractionEnabled = true // true to enable interaction
case 2:
createCell.isUserInteractionEnabled = false
default:
print("try again")
}
返回createCell
}//要启用或禁用特定单元格中的用户交互,可以尝试以下代码 func tableView(tableView:UITableView,cellForRowAt indexath:indexPath)->UITableViewCell{ //我已经使用guard Station创建了类的对象,如果您愿意,也可以使用它
guard let createCell = tableView.dequeueReusableCell(withIdentifier: "Create") as? CreateProfileCell else {
return CreateProfileCell()
}
//现在你们可以在你们想要的单元中启用或禁用用户交互,就像我在下面做的一样
切换到xpath.row{
case 0:
createCell.isUserInteractionEnabled = false . // false to disable interaction
case 1:
createCell.isUserInteractionEnabled = true // true to enable interaction
case 2:
createCell.isUserInteractionEnabled = false
default:
print("try again")
}
返回createCell
}Ya工作正常..再查询一次..如果我想从代码级别设置选择(无/单选/多选),我该怎么办?[cell setSelectionStyle:UITableViewCellSelectionStyleBlue];这就是我想要的…thanx a lotYa工作正常..再查询一次..如果我想设置选择(无/单选/多选)从代码级别我该怎么做?[cell setSelectionStyle:UITableViewCellSelectionStyleBlue];这是我想要的wt…thanx很多
case 0:
createCell.isUserInteractionEnabled = false . // false to disable interaction
case 1:
createCell.isUserInteractionEnabled = true // true to enable interaction
case 2:
createCell.isUserInteractionEnabled = false
default:
print("try again")
}