简体   繁体   English

UIView Animation 不工作

[英]UIView Animation isn't working

[UIView beginAnimations:nil context:UIGraphicsGetCurrentContext()];
[UIView setAnimationDuration:1.0];
[UIView setAnimationDelay:0.0];
[UIView setAnimationDelegate:self];
[UIView setAnimationTransition:UIViewAnimationTransitionCurlDown forView:viewHelp cache:YES];

[self.view addSubview:viewHelp];

[UIView commitAnimations];

Where am I doing wrong?我在哪里做错了? I am able to switch the view but I am not able to animate it.我可以切换视图,但无法为其设置动画。

[self.view addSubview:viewHelp]; the animation is just literally adding the subview, you need to work out what animation you want, and then apply it by changing values in the views frame property.? animation 只是从字面上添加子视图,您需要计算出您想要的 animation,然后通过更改视图框架属性中的值来应用它。

follow this thread: click me关注这个话题: 点我

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM