Reputation: 3984
I have 2 UIViewController
. I have just done a simple task.
Move from first view controller to second view controller.
First View Controller's Name : "My Information"
Issue is when I reach to the 2nd View Controller then I found back button title as "Back"
When I turn the simulator to landscape view then back button title is as "My Information"
What is the issue there? I could not understand.
Upvotes: 2
Views: 234
Reputation: 189
In "My Information" view controller add below code.
1) In viewWillAppear:(BOOL)animated
-(void)viewWillAppear:(BOOL)animated
{
[super viewWillAppear:animated];
self.navigationItem.backBarButtonItem =
[[UIBarButtonItem alloc] initWithTitle:@"Back"
style: UIBarButtonItemStylePlain
target:nil
action:nil];
}
Upvotes: 2
Reputation: 5932
@Dharmesh, please look at the code here code sample this shows after you change the mode to landscapeback button remains same.
Upvotes: 0
Reputation: 9387
This is probably because the title is too long. Try setting it to a shorter string, or set your own custom back button.
Upvotes: 2