J Duh
J Duh

Reputation: 161

Navigation bar's title being hidden behind the back title

Newbie here.
I'm creating a link between two views. The first view Current Books contains a list of books, and a + button which when clicked takes you to a new view called Add Book.
before segue

This is what it looks like before I add a segue between these two views.
after segue

This is what it looks like after I add a segue between these two, connected by the +

As you can see, the title 'Add Book' of my second activity goes invisible upon adding the segue. How would I get it to be visible again?

I also noticed that upon double clicking of the position of the invisible title, I am able to edit the title's text but it still won't make it appear! Please help! edit

Upvotes: 0

Views: 164

Answers (3)

Akshay Degada
Akshay Degada

Reputation: 139

Swift -->    self.navigationController?.isNavigationBarHidden = true
Objective C --> [self.navigationController setNavigationBarHidden:YES];

add line on Add Book ViewController

Upvotes: 0

Kazi Abdullah Al Mamun
Kazi Abdullah Al Mamun

Reputation: 1481

It seems that you added your own navigation bar in AddBookViewController scene of Storyboard. if so, just delete that navigation bar then drag segue from CurrentBooks + button, now select your AddBookViewController in Storyboard select your viewcontroller

then select show attribute inspector, and change your ViewController title. Attribute inspector

Thank you.

Upvotes: 1

Vinícius Barcelos
Vinícius Barcelos

Reputation: 401

You can setup title programatically in AddBookViewController.

self.title = "The title you want"

Put this in View Did Load

Upvotes: 0

Related Questions