0
votes

The structure is like this

tab bar controller -- > navigation Bar(item) --> view controller(with some buttons in right hand side.

in the view controller , the properties of the nav bar is loaded from :

override func viewWillAppear(animated: Bool) {

     currentUserId = PFUser.currentUser()!.objectId! as String
        self.navigationController?.setToolbarHidden(true, animated: true)
    if (isSegue == "CurrentUser")
    {
        UserId = PFUser.currentUser()!.objectId! as String
        self.navigationItem.title = "My Album"            
    }
    else
    {
        self.navigationItem.title = userName
        self.navigationItem.rightBarButtonItems = nil
    }

    //added to make navigation bar black - Subodh
        let nav = self.navigationController?.navigationBar
    var image = UIImage(named: "xxxxxxx")
    image = image?.imageWithRenderingMode(UIImageRenderingMode.AlwaysOriginal)

    self.navigationItem.leftBarButtonItem = UIBarButtonItem(image: image, style: UIBarButtonItemStyle.Done, target: self, action: "leftBarButtonPressed")
        nav?.barStyle = UIBarStyle.Black
        nav?.tintColor = UIColor.whiteColor()
        self.navigationController!.toolbar.barTintColor = UIColor.blackColor();
        self.navigationController?.hidesBarsOnTap = false

    self.tabBarController?.hidesBottomBarWhenPushed = true

    self.collectionView.reloadData()

}

When i was only using the nav bar it was working properly but now the nav bar is getting replaced with blank nav bar. there are two buttons on the navigation bar which does not show when i run the code.I tried hiding the nav bar from tab view controller by self.tabBarController?.hidesBottomBarWhenPushed = true but it is not working. also for the tabcontroller i can only set the title not other stuff. so how do i handle this?

1

1 Answers

0
votes

got it working by including this in viewdidload:

self.tabBarController?.navigationController?.navigationBarHidden = true