swift - 离开屏幕然后返回

时间:2017-07-20 12:18:28

标签: swift xcode uinavigationbar

我在NewHomePageVC启动了我的应用(NewHomePageVc是一个以编程方式制作的VC)并显示导航栏然后我点击退出转到SignInVcSigninVC是使用故事板制作并且是UITableviewController)并重新登录并返回NewHomePageVC,但这次没有导航栏?

在AppDelegate中:

  FIRApp.configure()
    window = UIWindow(frame: UIScreen.main.bounds)
    window?.makeKeyAndVisible()
    window?.rootViewController = UINavigationController(rootViewController: NewHomePageVC())

    return true

在NewHomePageVC中:

import UIKit

class NewHomePageVC: UITableViewController{

    var signInVC: SignInVC?
    var userScreenVC: usersScreenVC?
    var chatLogController: ChatLogController?
    var NewHomePage_Vc: NewHomePageVC?

    override func viewDidLoad() {
    super.viewDidLoad()


    func SetUpNavBarButtons(){

    }

    func SetUpNavBarButtons(){

        // navigationItem.leftBarButtonItem = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(handleLogout))

        let logOutButton = UIBarButtonItem(title: "Logout", style: .plain, target: self, action: #selector(handleLogout))

        let toUserScreenGrape = UIImage(named: "Grape Small Image")?.withRenderingMode(.alwaysOriginal)

        let toUserScreenGrapeButton = UIBarButtonItem(image: toUserScreenGrape, style: .plain, target: self, action: #selector(didTapUserScreenButton))

        let buttonsRight : NSArray = [toUserScreenGrapeButton]

        navigationItem.rightBarButtonItems = buttonsRight as? [UIBarButtonItem]
    }

    func didTapUserScreenButton() {
        let user_screen_vc = usersScreenVC()
        let navController = UINavigationController(rootViewController: user_screen_vc)
        present(navController, animated: true, completion: nil)

    }
}

1 个答案:

答案 0 :(得分:0)

问题最终出现在val df = Seq(("1","2","3","4","5","6")).toDF("A","B","C","D","E","F") val newdf = Seq(("1","2","3","4","5","6")).toDF("A","B","C","D","E","F") val cols = df.columns val temp = Array(df.select($"A"),df.select($"B"),df.select($"C"),df.select($"D"),df.select($"E"),df.select($"F")) val temp2 = Array(newdf.select($"A"),newdf.select($"B"),newdf.select($"C"),newdf.select($"D"),newdf.select($"E"),newdf.select($"F")) sparkSession.udf.register ( "myfunc" , ((A:Array[String],B:Array[String]) => {for(i <- 0 to 5)yield( if (A(i)==B(i)) "U" else "N")} ) ) val a = df.withColumn("A",callUDF("myfunc",(temp,temp2)))

之内

我改变了

SignInVC

self.present(NewHomePage_VC, animated: true, completion: nil)