CGAffineTransformMakeTranslation和CGAffineTransformScale在iOS7和iOS8中的变换不同。

3

我在视图控制器中有一个UITableView,并希望在视图控制器的中心缩小。在ios7中,以下代码能够正常工作:

CGSize appSize = [[UIScreen mainScreen] applicationFrame].size;
CGAffineTransform affineMatrix = CGAffineTransformMakeTranslation(appSize.width/2, 20);
affineMatrix = CGAffineTransformScale(affineMatrix, 0.5, 0.5);
self.transform = affineMatrix;

在更新到iOS8后,代码可能像这样可以正常工作,但在iOS7中却不能工作:

CGAffineTransform affineMatrix = CGAffineTransformMakeScale(0.5, 0.5);
affineMatrix = CGAffineTransformConcat(affineMatrix,CGAffineTransformMakeTranslation(0, -appSize.height/2+40));
self.transform = affineMatrix;

谁能解释为什么?同样的代码为什么我的工作正常?

1个回答

0

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接