0

I am displaying ticker View on navigation bar.And do not want to show back button. To hide back button I wrote the following code:

    -(void)viewWillAppear:(BOOL)animated
{
    self.navigationController.navigationBar.hidden=false;
    self.navigationController.navigationItem.leftBarButtonItem.tintColor=[UIColor clearColor];
    self.navigationController.navigationItem.hidesBackButton=true;
}

in every implementation file.

And applying ticker in app delegate didFinishLaunching method as below.

self.navController.navigationItem.hidesBackButton=YES;
[self.navController.navigationBar addSubview:[Constant BSE_Ticker]];
[self.navController.navigationBar addSubview:[Constant NSE_Ticker]];

but back button is not hiding. showing screen shot below

ScreenShot of back button not hiding

Thanks! I will appreciate any help.

Prince Kumar Sharma
  • 12,591
  • 4
  • 59
  • 90

2 Answers2

4

Try the following:

self.navigationItem.hidesBackButton = YES;
user427969
  • 3,836
  • 6
  • 50
  • 75
0

Try this:

[self.navigationItem setHidesBackButton:YES animated:YES];
Vishal
  • 8,246
  • 6
  • 37
  • 52