gpt4 book ai didi

ios - 导航栏没有出现?

转载 作者:IT王子 更新时间:2023-10-29 05:47:16 24 4
gpt4 key购买 nike

我目前正在使用一个名为 Eureka (https://github.com/xmartlabs/Eureka),出于某种原因每当我构建一个表单时,尽管导航栏没有出现我的 View Controller 嵌入在导航 Controller 中,它是设置为可见。有帮助吗?这是我的 repo 协议(protocol): https://github.com/ariff20/iTutor

代码

class SignUpViewController: FormViewController ,UINavigationBarDelegate{


override func viewDidLoad() {
super.viewDidLoad()

let logButton : UIBarButtonItem = UIBarButtonItem(title: "RightButtonTitle", style: UIBarButtonItemStyle.Done, target: self,action: "multipleSelectorDone")

self.navigationController?.navigationBar.hidden = false

self.navigationItem.rightBarButtonItem = logButton
form +++ Section("Your Basic Details")
<<< NameRow()
{
$0.placeholder = "Your Name"
}
<<< EmailRow()
{
$0.placeholder = "Email"
}
<<< PasswordRow()
{
$0.placeholder = "Password"
}
<<< PhoneRow()
{
$0.placeholder = "Your phone no,Customers will see this"
}

+++ Section("Select your Expertise")
<<< MultipleSelectorRow<String>
{
$0.title = "Choose your Subjects"
$0.options = ["English","Mandarin","Maths","Science","Bahasa Malaysia"]

}
.onPresent { from, to in
to.navigationItem.rightBarButtonItem = UIBarButtonItem(barButtonSystemItem: .Done, target: from, action:"multipleSelectorDone:")
}
<<< MultipleSelectorRow<String>
{
$0.title = "Choose your levels"
$0.options = ["Standard 1-3","Standard 4-6","Form 1-3","Form 4-5"]

}
.onPresent { from, to in
to.navigationItem.rightBarButtonItem = logButton}

<<< MultipleSelectorRow<String>
{
$0.title = "Choose your pricing range"
$0.options = ["RM30-RM40","RM40-RM60","RM60-RM80","RM80-RM100"]
}
.onPresent { from, to in
to.navigationItem.rightBarButtonItem = logButton}
+++ Section("Where can you teach?")
<<< TextRow()
{
$0.placeholder = "State"
}
<<< TextRow()
{
$0.placeholder = "Town,ex:Near Shah Alam"
}


}
override func viewWillAppear(animated: Bool)
{
super.viewWillAppear(true)
self.navigationController?.navigationBarHidden=false

}

func multipleSelectorDone(item:UIBarButtonItem)
{

navigationController?.popViewControllerAnimated(true)
}

输出

1

enter image description here

2

enter image description here

3

enter image description here

最佳答案

您正在像这样呈现您的 ViewController:

let vc = storyboard!.instantiateViewControllerWithIdentifier("TutorSignUp") as! SignUpViewController
self.presentViewController(vc, animated: true, completion: nil)

因此您的 SignUpViewController 实际上没有 UINavigationController 作为父级。

这将解决这个问题:

let vc = storyboard!.instantiateViewControllerWithIdentifier("TutorSignUp") as! SignUpViewController
let navigationController = UINavigationController(rootViewController: vc)
self.presentViewController(navigationController, animated: true, completion: nil)

关于ios - 导航栏没有出现?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35459392/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com