UISlider在的UIBarButtonItem影响动画行为 [英] UISlider in UIBarButtonItem impacts animation behavior

查看:198
本文介绍了UISlider在的UIBarButtonItem影响动画行为的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在IB,我设置与UIToolBar视图MyView的,我将其扔在UISlider。 IB自动嵌入它在的UIBarButtonItem,并设置其视图与UISlider。

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.

我这显示在MyView的动画导航控制器。

I display this MyView in a navigation controller with animation.

的UIViewController * myVC = [[UIViewController的页头] initWithNibName:@MyView的捆绑:无];结果
[self.navigationController pushViewController:myVC动画:是];结果
[myVC发行];

MyView的显示,但没有动画。除此之外,一切正常,根据需要我可以使用UISlider。
如果我从工具栏中删除的UISlider或者如果我把UISlider在视图本身,而不是在工具栏上,MyView的显示与动画。
我曾尝试与UIProgressView相同的,而不是它工作得很好(视图显示动画)。看来,UISlider作为一个的UIBarButtonItem $ P $的customView pvents动画。
我还检查了任何可能的泄漏。

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.

推荐答案

我跑进究竟同样的问题。我会打开带有UISlider并从这一点上,没有一个视图过渡在我的应用程序将被动画的看法。

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.

我结束了一个通用的UIView更换UIToolBar(听起来像你已经尝试过这种成功)。您可以将UIToolBar看看通过捕捉空的工具栏的图像,并使用伪造总是随着视图中的背景。

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.

这篇关于UISlider在的UIBarButtonItem影响动画行为的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆