0

I have used this code:

[[self.view viewWithTag:100] setTransform:CGAffineTransformMakeScale(0.009, 0.009)];
UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:0.5];
[UIView setAnimationRepeatAutoreverses:NO];
[UIView setAnimationRepeatCount:0];
[[self.view viewWithTag:100] setTransform:CGAffineTransformMakeScale(1, 1)];
[UIView commitAnimations];

in viewWillAppear of my popup view. The code works fine on simulator and produces nice effect in which my view appears to grow from center, however on device the animation effect is absent its more like sleep of 0.5 and then all off a sudden view appears.

Since this view is used liberally i don't want to increase duration any help?

4

1 回答 1

0

实际上,代码示例适用于我viewDidLoadviewWillAppear.Increased 时间和动画在这里工作正常。为什么要使用这种方法?Apple 提供了一种新的、更好的技术来制作视图动画。

尝试这个

[[self.view viewWithTag:100] setTransform:CGAffineTransformMakeScale(0.009, 0.009)];
    [UIView animateWithDuration:10.5 animations:^{
        [[self.view viewWithTag:100] setTransform:CGAffineTransformMakeScale(1, 1)];
    }];
于 2013-01-28T06:46:32.080 回答