【发布时间】:2017-04-26 19:14:58
【问题描述】:
我正在尝试通过这种方法将高度乘数从 0 更改为 1,从而创建 tableView 部分标题的平滑外观:
.sectionHeaderHeight.multiply(by: _) 其中 _ 应该是 CGFloat。
代码:
override func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
tableView.sectionHeaderHeight.multiply(by: _)
}
不幸的是,标题似乎只能取0(隐藏)或1。
大于 1 的所有内容都会破坏 UI,介于 0 和 1 之间的所有内容都会生成 error:
*** -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] 中的断言失败, /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit_Sim/UIKit-3600.7.47/UITableViewRowData.m:443
【问题讨论】:
标签: ios swift uitableview