gpt4 book ai didi

ios - 如何从选定的表格 View 单元格中获取标题部分标题?

转载 作者:搜寻专家 更新时间:2023-10-31 08:22:21 25 4
gpt4 key购买 nike

我有一个包含多个部分的表格 View 。我想要的是当我从我想要该部分的标题标题的部分中选择一个特定的 tableview 单元格时。我看了几个 SO 问题,但没有发现任何有用的东西。提前致谢。

最佳答案

在tableviewcell的点击方法中可以通过以下代码获取title

UITableViewHeaderFooterView* header =[self.tableView headerViewForSection:indexPath.section];
NSLog(@"Header text = %@", header.textLabel.text);

在 swift 中

let sectionHeaderView = table.headerViewForSection(indexPath.section)
let sectionTitle = sectionHeaderView?.textLabel?.text

关于ios - 如何从选定的表格 View 单元格中获取标题部分标题?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41561660/

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