gpt4 book ai didi

iphone - 如何使 UITableView 上的单元格不可选?

转载 作者:IT老高 更新时间:2023-10-28 11:30:02 26 4
gpt4 key购买 nike

我有一个要插入到 UITableView 顶部的单元格。如何确保当用户单击单元格时,它不会显示蓝色选定指示器?

最佳答案

要取消根据行索引选择任何表格单元格或特定表格单元格的功能,请使用 willSelectRowAt

func tableView(_ tableView: UITableView, willSelectRowAt indexPath: IndexPath) -> IndexPath? {


return nil
}

要简单地移除选择元素的 UI 效果,设置 selection style of the UITableViewCellUITableViewCellSelectionStyleNone

swift 5:

selectionStyle = .none

关于iphone - 如何使 UITableView 上的单元格不可选?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2641530/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com