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?

有帮助吗?

解决方案

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

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top