我对iPhone和UITableView
节脚有问题。它被“隐藏”在顶部切割部分的后面。
我有这样的代码:
override func tableView(_ tableView: UITableView, viewForFooterInSection section: Int) -> UIView? {
var content = "some long text"
let footerView = UIView(frame: CGRect(x: 0, y: 0, width: view.frame.size.width, height: 40))
let explanationLabel = UILabel(frame: CGRect(x: 10, y: 0, width: view.frame.size.width - 20, height: 50))
explanationLabel.font = UIFont.systemFont(ofSize: 14, weight: UIFont.Weight.light)
explanationLabel.textColor = UIColor.darkGray
explanationLabel.numberOfLines = 0
explanationLabel.lineBreakMode = .byTruncatingTail
explanationLabel.text = content
footerView.addSubview(explanationLabel)
return footerView
}
我的UITableViewController
是从故事板添加的,并且设置了安全区。我对表格线没有问题,只有部分页脚有问题。
转载请注明出处:http://www.lechuangzk.com/article/20230526/1075686.html