首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >CGAffineTransform不能正常工作

CGAffineTransform不能正常工作
EN

Stack Overflow用户
提问于 2012-07-04 01:56:41
回答 1查看 2K关注 0票数 0

我想让我的变换在平移图像的同时缩放图像,可以用同样的方法吗?

代码语言:javascript
复制
    [UIView beginAnimations:annKey context:NULL];
    [UIView setAnimationDelegate:self];
    [UIView setAnimationDuration:duration];
    [UIView setAnimationCurve:curve];
    [UIView setAnimationBeginsFromCurrentState:YES];
    [UIView setAnimationDidStopSelector:@selector(animationFinished:finished:context:)];
    CGAffineTransform transform = CGAffineTransformMakeTranslation(x, y);
    CGAffineTransform scale = CGAffineTransformMakeScale(xx, yy);
    image.transform = scale;
    image.transform = transform;
    [UIView commitAnimations];
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2012-07-04 02:01:55

您必须使用CGAffineTransformConcat将这两个转换连接在一起,以转换和缩放视图。您当前只是将比例变换替换为平移。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/11316488

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档