iphone – :CGAffineTransformInvert:奇异矩阵

栏目: IOS · 发布时间: 6年前

内容简介:翻译自:https://stackoverflow.com/questions/17145114/error-cgaffinetransforminvert-singular-matrix

我试图在视图上执行此动画,将其缩放到(0,0)然后使用CGRectMake方法移动此帧并将其缩放回(1,1).

所以我使用以下代码来执行此操作

-(void)startWalkAnimationStartWalkingBtnViewScaleToZero{
    CGAffineTransform transform = StartWalkBtnView.transform;

    StartWalkBtnView.transform=CGAffineTransformScale(transform,1.0f, 1.0f);
    [UIView animateWithDuration: 0.7
                          delay: 0.6
                        options: (UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction)
                     animations:^{ StartWalkBtnView.transform = CGAffineTransformScale(transform, 0.0f, 0.0f);
                     }
                     completion:^(BOOL finished){
                         [UIView animateWithDuration:0.0
                                               delay:0.0
                                             options: UIViewAnimationOptionCurveEaseIn
                                          animations:^{
                                              StartWalkBtnView.frame=CGRectMake(92, 270, 120, 121);
                                          }
                                          completion:^(BOOL finished){

                                              StartWalkBtnView.transform=CGAffineTransformScale(transform,0.0f, 0.0f);
                                              [UIView animateWithDuration: 0.7
                                                                    delay: 0.8
                                                                  options: (UIViewAnimationOptionCurveLinear | UIViewAnimationOptionAllowUserInteraction)
                                                               animations:^{ StartWalkBtnView.transform = CGAffineTransformScale(transform, 1.0f, 1.0f);
                                                               }
                                                               completion:^(BOOL finished){}
                                               ];
                                          }];
                     }
     ];
}

但在尝试运行此动画后,我在控制台中收到以下错误.

Jun 17 12:02:49 Kareem.local MyAppName[3157] <Error>: CGAffineTransformInvert: singular matrix.

我用Google搜索了太多,并尝试了所提供的所有解决方案(Scale Near to zere Value,…)但没有任何效果,任何人都有解决这个问题的想法.

感谢帮助

更新:

我在以下行找到了问题:

StartWalkBtnView.frame = CGRectMake(92,270,120,121);

但实际上我不知道如何解决这个问题,但当我删除这一行时它缩小为零然后从零回来通常没有任何错误

网页的内容可能是此错误的原因,而不是您的iOS应用程序编程.

我发现我的应用程序只在 Yahoo 上发生了错误.Google.com,没问题. Reuters.com,没问题. SeattleTimes.com,没问题.回到Yahoo.com,问题.特别是在滚动时,错误可能会在一瞬间出现几次.

关于 my blog 的更多细节.

翻译自:https://stackoverflow.com/questions/17145114/error-cgaffinetransforminvert-singular-matrix


以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持 码农网

查看所有标签

猜你喜欢:

本站部分资源来源于网络,本站转载出于传递更多信息之目的,版权归原作者或者来源机构所有,如转载稿涉及版权问题,请联系我们

Head Rush Ajax

Head Rush Ajax

Brett McLaughlin、Eric Freeman、Elisabeth Freeman / O'Reilly Media, Inc. / 2006-03-01 / USD 34.99

Ajax, or Asynchronous JavaScript and XML, is a term describing the latest rage in web development. Ajax is used to create interactive web applications with XML-based web services, and using JavaScript......一起来看看 《Head Rush Ajax》 这本书的介绍吧!

RGB HSV 转换
RGB HSV 转换

RGB HSV 互转工具

HEX CMYK 转换工具
HEX CMYK 转换工具

HEX CMYK 互转工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具