如何在 UIView 动画之前更新 UI
我在程序中向 UIView 添加了一个动画。视图中有很多控件。我试图在动画之前隐藏一些控件,所以我将隐藏属性设置为YES。但它不起作用。在动画过程中它仍然在图层上可见。
这是一些代码:
button.hidden = YES;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[UIView commitAnimations]
谁能告诉我如何在动画之前隐藏控件? 或者如何更新控制雕像(控制位置,可见等)
谢谢
I add an animation to UIView in my program. There are many controls in the view. I tried to hide some controls before animation, so I set hidden property to YES. But it didn't work.It still visible on the layer during the animation.
here is some code:
button.hidden = YES;
[UIView beginAnimations:nil context:nil];
[UIView setAnimationDuration:1.0f];
[UIView setAnimationCurve:UIViewAnimationCurveEaseInOut];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:self.view cache:YES];
[UIView commitAnimations]
Could any one tell me how to hide controls before animation?
Or how to update control statues(control position, visible, etc)
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您尝试为视图设置动画,则设置其新值的语句(例如(
button.hidden = YES
))应位于动画块内,如下所示。If you're trying to animate a view, the statement that sets its new value, like (
button.hidden = YES
), should be located INSIDE your animation block, like so.