pdrcabrod
pdrcabrod

Reputation: 1477

Navigation bar. Right bar button doesn't animate

Im adding a right bar button to my navigation bar. It appears and it works fine.

The problem is that it´s not animated. I mean, when I move to other views by clicking in some row, it just suddenly pops out and you can see the new view moving behind it until the sliding animation is finished.

UIBarButtonItem *closeButton = [[UIBarButtonItem alloc] initWithTitle:@"Close"style:UIBarButtonItemStylePlain target:self    action:@selector(closePopOver)];
[self.navigationItem setRightBarButtonItem: closeButton animated:YES];
[closeButton release];

And I add it in the initWithNibName: method. I´ve tried to move it to the viewDidLoad and it didn't work.

Any ideas?

Upvotes: 3

Views: 821

Answers (1)

Jerry Thomsan
Jerry Thomsan

Reputation: 1409

There are specific methods you can use to animate the right bar button items:

[self.navigationItem setRightBarButtonItem: self.addToOrderButton animated:YES];

Upvotes: 2

Related Questions