English 中文(简体)
变迁的VIewControllers停止了 an
原标题:Changing VIewControllers stops animations

(一) 对一名tab巴view目控制器的首层控制器有这种估计

- (void)viewDidAppear:(BOOL)animated
{
    [UIView animateWithDuration:4.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear animations:^{
        CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI);
        self.rotatingImage.transform = transform;
    } completion:NULL];
}

它很出色地运作,但当从禁忌中改变视力控制器并返回到第一个观察控制器时,就停止了。

https://stackoverflow.com/questions/8489638/ios-uiview-animation-issue”

最佳回答

引证:

- (void)viewDidAppear:(BOOL)animated
{
    [super viewDidAppear:animated];
    self.rotatingImage.transform = CGAffineTransformIdentity;
    [UIView animateWithDuration:4.0 delay:0.0 options:UIViewAnimationOptionRepeat | UIViewAnimationOptionCurveLinear animations:^{
        CGAffineTransform transform = CGAffineTransformMakeRotation(M_PI);
        self.rotatingImage.transform = transform;
    } completion:NULL];
}

解释简单明了......在再次发射《估算法》时,UIImage语的转变已经等同于 an语的最终转变。 这与将UIImage语的字母从1.0升至1.0相类似,没有任何变化。

问题回答

Use following code and enjoy...

self.animationyourImageView.transform = CGAffineTransformIdentity;

它将重新启动你们的变革。

希望将有助于你们。





相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签