Question

In IB, I set a view MyView with an UIToolBar and I drop an UISlider on it. IB automatically embeds it in an UIBarButtonItem and sets its view with the UISlider.

I display this MyView in a navigation controller with animation.

UIViewController *myVC = [[UIViewController alloc] initWithNibName:@"MyView" bundle:nil];
[self.navigationController pushViewController:myVC animated:YES];
[myVC release];

MyView is displayed but without animation. Apart from that, everything works fine, I can use the UISlider as needed. If I remove the UISlider from the toolbar or if I put the UISlider in the view itself, not in the toolbar, MyView is displayed with animation. I have tried the same with an UIProgressView instead and it worked fine ( view is displayed with animation ). It seems that UISlider as customView of an UIBarButtonItem prevents the animation. I have also checked for any possible leaking.

Any idea ? Thanks Tart.

Was it helpful?

Solution

I ran into exactly the same issue. I would open the view with the UISlider and from that point on, none of the view transitions in my application would be animated.

I ended up replacing the UIToolBar with a generic UIView (sounds like you've already tried this with success). You could always fake the UIToolBar look by capturing an image of an empty toolbar and using that as the background in your view.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top