フッタービューの下のスペースを削除したいだけです。iPhone 11のすべてのバージョンで表示されています。フッターをセクションセルの最後ではなく、常に画面に表示したいです。テーブルビューコントローラーのスクリーンショット
ここに私のコードがあります
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)
}
}