///设置header的背景透明
func tableView(_ tableView: UITableView, willDisplayHeaderView view: UIView, forSection section: Int) {
let v = (view as? UITableViewHeaderFooterView)
if #available(iOS 14.0, *) {
v?.backgroundConfiguration?.backgroundColor = .clear
} else {
// Fallback on earlier versions
v?.backgroundView = UIView()
}
}
网友评论