首页 > 代码库 > ios <Error>: CGAffineTransformInvert: singular matrix.

ios <Error>: CGAffineTransformInvert: singular matrix.

       

如果你尝试,并设置缩放比例为零,你会得到这个消息:<Error>: CGAffineTransformInvert: singular matrix.

   [UIViewanimateWithDuration:0.5animations:^{

                CGAffineTransform newTransform = CGAffineTransformScale(myView, 0.0,0.0);

                [myView setTransform:newTransform];

            } completion:^(BOOL finished) {

            }];


改为:CGAffineTransform newTransform =  CGAffineTransformScale(s.transform0.0001f0.00001f);