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


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

查看所有标签

猜你喜欢:

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

设计原本

设计原本

Frederick P. Brooks, Jr. / InfoQ中文站、王海鹏、高博 / 机械工业出版社 / 2011-1-1 / 55.00元

无论是软件开发、工程还是建筑,有效的设计都是工作的核心。《设计原本:计算机科学巨匠Frederick P. Brooks的思考》将对设计过程进行深入分析,揭示进行有效和优雅设计的方法。 本书包含了多个行业设计者的特别领悟。Frederick P. Brooks, Jr.精确发现了所有设计项目中内在的不变因素,揭示 了进行优秀设计的过程和模式。通过与几十位优秀设计者的对话,以及他自己在几个设计......一起来看看 《设计原本》 这本书的介绍吧!

XML 在线格式化
XML 在线格式化

在线 XML 格式化压缩工具

正则表达式在线测试
正则表达式在线测试

正则表达式在线测试