문제

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