views:

335

answers:

1

Hi all

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.

A: 

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.

Chris Karcher
Thanks Chris, actually I just took the UISlider out of the UIToolbar, place it where it should be. I have then added the UIToolbar as first object in the View in IB, and it worked. Apparently, the problem occurs when the UISlider is embedded in the UIToolbar.
Tart