ios – 导航栏没有出现?

我目前正在使用一个名为的表单构建库
尤里卡( https://github.com/xmartlabs/Eureka)由于某种原因
每当我构建一个表单时,导航栏都不会出现
我的视图控制器嵌入在导航控制器中,它是
设置为可见.任何帮助?这是我的回购:
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)
}

OUTPUT

1

2

3

解决方法

你正在展示你的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,completion: nil)

相关文章

UITabBarController 是 iOS 中用于管理和显示选项卡界面的一...
UITableView的重用机制避免了频繁创建和销毁单元格的开销,使...
Objective-C中,类的实例变量(instance variables)和属性(...
从内存管理的角度来看,block可以作为方法的传入参数是因为b...
WKWebView 是 iOS 开发中用于显示网页内容的组件,它是在 iO...
OC中常用的多线程编程技术: 1. NSThread NSThread是Objecti...