gpt4 book ai didi

iphone - 只能旋转一次UIImageView

转载 作者:行者123 更新时间:2023-12-01 18:00:32 25 4
gpt4 key购买 nike

我有一些代码,当用户触摸图像时,这会使UIImageView旋转180度。不幸的是,当用户再次触摸它时,什么也没有发生。我假设确定图像已经旋转了180度,这可能就是为什么它不再移动的原因。谢谢,我该如何解决这个问题。

-(void) spinSun
{
[UIView animateWithDuration:2.0f animations:^{
imgSun.transform = CGAffineTransformMakeRotation(-3.142);
} completion:^(BOOL finished) {

}];
}

最佳答案

您必须创建一个新的转换矩阵:

imgSun.transform = CGAffineTransformRotate(imgSun.transform, -3.142)

关于iphone - 只能旋转一次UIImageView,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10583119/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com