Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Navigation controller doesnt add back button

I have a view which pushes a new view onto the screen.

When the new view is shown, there is no back button in the navigation controller.

I have the following in one view

enter image description here

and I push a new view using the following code

[photoViewController setAsset:[assets objectAtIndex:(cell.rowNumber * 4) + index]];
[[self navigationController] pushViewController:photoViewController animated:YES];
[photoViewController release];

When the view appears the following is visible

enter image description here

How do I add the back button and where would I add the same share button to the bar in the second view?

Thanks. :)

like image 856
some_id Avatar asked May 22 '26 00:05

some_id


1 Answers

You need to set a title in your first view. The back button uses the title of the previous view. If one is not set then the back button will not be displayed.

In the viewDidLoad method of your first view, use self.title = @"title";

like image 135
Ken Joyner Avatar answered May 24 '26 12:05

Ken Joyner



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!