Swift Eureka:表单标题位于导航栏下方
我从tableView调用了PerformScheue,并将其推到FormVC。然而,尽管UIView在y轴上偏移了100点,但我的标题仍位于导航栏下方。 我的代码如下:Swift Eureka:表单标题位于导航栏下方,swift,eureka-forms,Swift,Eureka Forms,我从tableView调用了PerformScheue,并将其推到FormVC。然而,尽管UIView在y轴上偏移了100点,但我的标题仍位于导航栏下方。 我的代码如下: override func prepare(for segue: UIStoryboardSegue, sender: Any?) { if segue.identifier == "EventsDetails" { let destVC = segue.destination as!
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
}()
}
}
}
override func prepare(对于segue:UIStoryboardSegue,发送方:Any?){
如果segue.identifier==“EventsDetails”{
让destVC=segue.destination为!EventsDetailsViewController
}
}
类事件DetailsViewController:FormViewController{
重写func viewDidLoad(){
super.viewDidLoad()
形式+++
Section(){Section in
节头={
var header=HeaderFooterView(.callback)({
let view=ui视图(帧:CGRect(x:0,y:100,宽度:100,高度:180))
设imageView=UIImageView(帧:CGRect(x:20,y:10,宽度:80,高度:80))
imageView.backgroundColor=.red
imageView.layer.cornerRadius=imageView.frame.size.width/2
imageView.clipsToBounds=true
让namelab=UILabel(帧:CGRect(x:120,y:40,宽度:150,高度:20))
namelab.text=“测试文本”
nameLabel.backgroundColor=.blue
nameLabel.font=UIFont.boldSystemFont(字体大小:18.0)
view.addSubview(imageView)
view.addSubview(名称标签)
view.backgroundColor=.white
返回视图
}))
header.height={200}
回流集管
}()
}
}
}
是否有方法将视图向下移动到导航栏的底部?顺便说一句,我用故事板。我知道这可能是一个原始的问题,但一些建议是非常感谢,谢谢 设置。。self.navigationbar.opaque=false。@sourav不工作。我不希望它是不透明的,但我希望视图向下移动到视图的底部navBar@Koh我无法重现您的问题,对我来说效果很好,我只需在NavigationController中添加一个viewController和一个TabBarController,我不会更改任何约束