ios - 我想用tableview设计三层。谁能解释
问题描述
我想用tableview设计三层。谁能解释
if indexPath.section == 0 {
if indexPath.row == 0 {
let cell = tableView.dequeueReusableCell(withIdentifier: "HederCell") as? HederCell
cell?.textLabel?.text = getData?.mainservice_name
return cell!
}
我试图使这种类型无法正常工作,
请检查下图以更好地理解我的问题。
解决方案
如果您想在表格视图单元格之前添加一些文本,请使用此重写方法并使用 UIview 相应地设计您的单元格。
func tableView(_ tableView: UITableView, titleForHeaderInSection section: Int) -> String? {
}
推荐阅读
- javascript - 如何在 javascript 中实现委托(c#)之类的东西?
- apache-spark - 如何将微批量数据聚合到数据帧中以进行 Spark 结构化流式传输?
- java - 在类路径资源 Mongobee 中定义名称为“mongoTemplate”的 bean 创建错误
- fonts - 中文 PDF 字体 STSong-Light 不适用于 Jasper Report
- ibm-mq - IBM MQ 消息复制到新队列
- reactjs - React redux thunk 如何获得一个更新的 reducer 值?
- python - 在 django celery 的上下文中使用函数列表
- linux - 接受来自 write 命令的消息的安全风险
- javascript - newsapi 不起作用?访问从源“null”获取...控制台中的错误
- oauth - OAuth2 授予类型客户端凭据 - 是否允许使用 GET 方法