Title of navigation bar does not appear

61 views Asked by At

I have a navigationBar on my Crossmobile application, I want to add Title on it and I'm using the bellow code:

navigationController().navigationBar().setBarTintColor(UIColor.colorWithRedGreenBlueAlpha(69.0 / 255.0, 69.0 / 255.0, 69.0 / 255.0, 1.0));

I put that code and it does nothing:

navigationController().navigationItem().setPrompt("titleTest");

I found the navigationItem from documentation of UINavigationBar from https://developer.apple.com/documentation/uikit/uinavigationbar

has anyone idea how to add the view of the item?

1

There are 1 answers

0
Panayotis On

In your view controller's intialization, i.e. in the constructor, you have to do something like:

setTitle("titleTest");

Alternatively, you could work on navigationItem and define the title like this:

navigationController().navigationItem().setTitle("titleTest");

You don't change the title of the navigation bar directly