【发布时间】:2018-05-11 13:24:13
【问题描述】:
我已经使用 UITableview 部分标题和其他单元格来显示内容,但是当涉及到角半径时,我们如何才能在没有任何痛苦的情况下实现这样的布局。
我试图为从 topLeft、topRight 和最后一个单元格到 bottomLeft、bottomRight 的 tableview 标题提供角半径,但它对我不起作用。
func tableView(_ tableView: UITableView, viewForHeaderInSection section: Int) -> UIView? {
guard let headerView = tableView.dequeueReusableCell(withIdentifier: "headerCell") as? headerCell else { return UIView() }
headerView.labelTaskName.text = arrayTaskLists[section].first?.outcome_title
headerView.viewContainerHeader.roundCorners([.topRight,.topLeft], radius: 10.0)
headerView.viewContainerHeader.layoutSubviews()
headerView.btnHeaderViewCell.tag = section
headerView.delegate = self
return headerView
}
func tableView(_ tableView: UITableView, heightForHeaderInSection section: Int) -> CGFloat {
return 44
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: CellIdentifier.TaskInformationCell) as! TaskInformationCell
cell.infoView.roundCorners([.bottomLeft,.bottomRight], radius: 10.0)
cell.infoView.layoutSubviews()
}
感谢您的帮助。
【问题讨论】:
-
我同意您的问题太不完整,无法提供帮助。也就是说,考虑研究“容器视图”。在 it 周围放置一个圆角半径并插入您的表格视图。
-
为什么它被否决了?在这里寻求任何帮助或讨论的想法不应该被否决
-
编辑了一个问题@user770,@dfd
-
@user770 是什么意思?
-
@user770 :如果你不明白,那你为什么还投了反对票?我在这里粘贴了一个代码
标签: ios swift uitableview uitableviewsectionheader