我从tableView调用了performSegue并将其推送到FormVC。但是,我的标题位于navigationBar下面,尽管UIView在y轴上偏移了100磅。
我的代码如下:
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "EventsDetails" {
let destVC = segue.destination as! EventsDetailsViewController
}
}
class EventsDetailsViewController: FormViewController {
override func viewDidLoad() {
super.viewDidLoad()
form +++
Section(){ section in
section.header = {
var header = HeaderFooterView<UIView>(.callback({
let view = UIView(frame: CGRect(x: 0, y: 100, width: 100, height: 180))
let imageView = UIImageView(frame: CGRect(x: 20, y: 10, width: 80, height: 80))
imageView.backgroundColor = .red
imageView.layer.cornerRadius = imageView.frame.size.width / 2
imageView.clipsToBounds = true
let nameLabel = UILabel(frame: CGRect(x: 120, y: 40, width: 150, height: 20))
nameLabel.text = "Test Text"
nameLabel.backgroundColor = .blue
nameLabel.font = UIFont.boldSystemFont(ofSize: 18.0)
view.addSubview(imageView)
view.addSubview(nameLabel)
view.backgroundColor = .white
return view
}))
header.height = { 200 }
return header
}()
}
}
}
有没有办法将视图向下移动到navBar的底部?顺便说一下,我使用故事板。我知道这可能是一个原始问题,但是非常感谢一些建议,谢谢!