【发布时间】:2020-07-09 07:35:12
【问题描述】:
我只想删除页脚视图下方的空间。它显示在所有版本的 iPhone 11 上。我希望我的页脚始终显示在屏幕上,而不是在部分单元格的末尾。screenshot of my tableview controller
这是我的代码
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
let footer=tableView.dequeueReusableHeaderFooterView(withIdentifier: "footerCell") as! FooterCell
return footer
}
class FooterCell:PostSectionBase{
lazy var button:UIButton={
let button=UIButton()
button.layer.cornerRadius=10
button.layer.borderColor=UIColor(red: 59/255, green: 178/255, blue: 250/255, alpha: 1).cgColor
button.layer.borderWidth=1
button.backgroundColor=UIColor(red: 59/255, green: 178/255, blue: 250/255, alpha: 1)
button.setTitle("Confirm", for: .normal)
button.titleLabel?.font=UIFont.init(name: "HelveticaNeue-Bold", size: 19)
button.titleLabel?.adjustsFontSizeToFitWidth = true
button.titleLabel?.minimumScaleFactor = 0.5
button.setTitleColor(UIColor.white, for: .normal)
return button
}()
override func setupViews(){
setupContainerView()
}
func setupContainerView(){
addSubview(button)
addConstraintsWithFormat(format: "H:|-40-[v0]-40-|", views: button)
addConstraintsWithFormat(format: "V:|-40-[v0(40)]-40-|", views: button)
}
}
【问题讨论】:
标签: ios swift uitableview footer